mirror of
https://github.com/GTNewHorizons/FindIt.git
synced 2026-11-24 18:24:21 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
296f29ae76 | ||
|
|
84dd2e45f9 | ||
|
|
3b6d5fa3ad | ||
|
|
f2b4c1a262 | ||
|
|
199f1d81e1 | ||
|
|
c764b60a83 | ||
|
|
c793ceec36 | ||
|
|
fd292e5649 | ||
|
|
5c78cd6e54 | ||
|
|
b03be8e3a7 | ||
|
|
f925a189b0 | ||
|
|
b537a26003 | ||
|
|
82c33ae3c7 | ||
|
|
f34980692b | ||
|
|
ab6c722369 | ||
|
|
b0c4b81d5f | ||
|
|
b3c002b42b | ||
|
|
d78625b514 | ||
|
|
511b388b83 | ||
|
|
9278283ae8 | ||
|
|
492dfdae60 | ||
|
|
1dd669348e | ||
|
|
2eabe09ad0 | ||
|
|
3c9f849587 | ||
|
|
e3cfb6835f | ||
|
|
bcfec26e0c | ||
|
|
6795089c33 | ||
|
|
9a54f7c6b2 | ||
|
|
d9c5b0e035 | ||
|
|
fe1c5123c7 | ||
|
|
641288386d | ||
|
|
18972388a7 | ||
|
|
270bc77fbd | ||
|
|
2e73da4e25 | ||
|
|
3fbc4eebac | ||
|
|
fc56416560 | ||
|
|
41e2db4644 | ||
|
|
4a11c18f99 | ||
|
|
35b27ed27f | ||
|
|
fc025b3b85 | ||
|
|
9d6ce05d9e | ||
|
|
0c2a7beed9 | ||
|
|
f1313bfc48 | ||
|
|
28859a3f6e | ||
|
|
58b41c6bb5 | ||
|
|
f6eb09de3a | ||
|
|
f31f2e3adf | ||
|
|
1bf51f5a48 | ||
|
|
f2dc81704a | ||
|
|
0e2d9e02a4 | ||
|
|
1f4c5b0058 | ||
|
|
bdf41e7ed8 |
No files matched your search
@@ -0,0 +1,2 @@
|
|||||||
|
# Ignore spotlessApply reformat
|
||||||
|
f2dc81704a965d1f2ada7500842bc904f0ca7ddc
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
* text eol=lf
|
||||||
|
|
||||||
|
*.[jJ][aA][rR] binary
|
||||||
|
|
||||||
|
*.[pP][nN][gG] binary
|
||||||
|
*.[jJ][pP][gG] binary
|
||||||
|
*.[jJ][pP][eE][gG] binary
|
||||||
|
*.[gG][iI][fF] binary
|
||||||
|
*.[tT][iI][fF] binary
|
||||||
|
*.[tT][iI][fF][fF] binary
|
||||||
|
*.[iI][cC][oO] binary
|
||||||
|
*.[sS][vV][gG] text
|
||||||
|
*.[eE][pP][sS] binary
|
||||||
|
*.[xX][cC][fF] binary
|
||||||
|
|
||||||
|
*.[kK][aA][rR] binary
|
||||||
|
*.[mM]4[aA] binary
|
||||||
|
*.[mM][iI][dD] binary
|
||||||
|
*.[mM][iI][dD][iI] binary
|
||||||
|
*.[mM][pP]3 binary
|
||||||
|
*.[oO][gG][gG] binary
|
||||||
|
*.[rR][aA] binary
|
||||||
|
|
||||||
|
*.7[zZ] binary
|
||||||
|
*.[gG][zZ] binary
|
||||||
|
*.[tT][aA][rR] binary
|
||||||
|
*.[tT][gG][zZ] binary
|
||||||
|
*.[zZ][iI][pP] binary
|
||||||
|
|
||||||
|
*.[tT][cC][nN] binary
|
||||||
|
*.[sS][oO] binary
|
||||||
|
*.[dD][lL][lL] binary
|
||||||
|
*.[dD][yY][lL][iI][bB] binary
|
||||||
|
*.[pP][sS][dD] binary
|
||||||
|
*.[tT][tT][fF] binary
|
||||||
|
*.[oO][tT][fF] binary
|
||||||
|
|
||||||
|
*.[pP][aA][tT][cC][hH] -text
|
||||||
|
|
||||||
|
*.[bB][aA][tT] text eol=crlf
|
||||||
|
*.[cC][mM][dD] text eol=crlf
|
||||||
|
*.[pP][sS]1 text eol=crlf
|
||||||
|
|
||||||
|
*[aA][uU][tT][oO][gG][eE][nN][eE][rR][aA][tT][eE][dD]* binary
|
||||||
@@ -3,9 +3,9 @@ name: Build and test
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master, main ]
|
branches: [ master, main, release/** ]
|
||||||
push:
|
push:
|
||||||
branches: [ master, main ]
|
branches: [ master, main, release/** ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-test:
|
build-and-test:
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
name: Optimize images
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches: [ master, main, release/** ]
|
||||||
|
paths:
|
||||||
|
- "**/*.png"
|
||||||
|
|
||||||
|
push:
|
||||||
|
branches: [ master, main, release/** ]
|
||||||
|
paths:
|
||||||
|
- "**/*.png"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
optimize-images:
|
||||||
|
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/optimize-images.yml@master
|
||||||
|
secrets: inherit
|
||||||
@@ -29,3 +29,4 @@ src/main/resources/mixins.*.json
|
|||||||
*.bat
|
*.bat
|
||||||
*.DS_Store
|
*.DS_Store
|
||||||
!gradlew.bat
|
!gradlew.bat
|
||||||
|
layout.json
|
||||||
@@ -1,8 +1,22 @@
|
|||||||
# FindIt
|
# FindIt
|
||||||
##### For those times when you just can't remember where you placed your EV Mixer!
|
##### For those times when you just can't remember where you placed your EV Mixer!
|
||||||
|
|
||||||
This is inspired by the "Search in nearby inventories" feature from 1.7.10 Extra Utilities, and from 1.12+ [FindMe](https://github.com/Buuz135/FindMe). Instead of searching inventories, FindIt will search the world for placed tile entities!
|
This is inspired by the "Search in nearby inventories" feature from 1.7.10 Extra Utilities, and from 1.12+ [FindMe](https://github.com/Buuz135/FindMe). As well as searching for items and fluids in inventories, FindIt will also search the world for placed tile entities!
|
||||||
|
|
||||||
Did you forget where you placed your EV Mixer?
|
Did you forget where you placed your EV Mixer?
|
||||||
|
|
||||||
Well no problem now! Locate the item in NEI; however over it and hit 'Y' (the default keybind); if it's within range (+/-16 blocks) it will flash particle effects for you to locate it!
|
Well, no problem now! Locate the item in NEI, hover over it, and hit 'Y' (the default keybind). If it's within range (+/-16 blocks), an outline will flash around it for you to locate it!
|
||||||
|
|
||||||
|
Dependencies:
|
||||||
|
[NotEnoughItems](https://github.com/GTNewHorizons/NotEnoughItems)
|
||||||
|
[GTNHLib](https://github.com/GTNewHorizons/GTNHLib)
|
||||||
|
|
||||||
|
FindIt has special support for the following mods' containers:
|
||||||
|
* [AdventureBackpack](https://github.com/GTNewHorizons/AdventureBackpack2): Finds items and fluids inside backpacks when inside another container.
|
||||||
|
* [Minecraft Backpack Mod](https://github.com/GTNewHorizons/Minecraft-Backpack-Mod/): Finds items inside backpacks when inside another container.
|
||||||
|
* [Forestry](https://github.com/GTNewHorizons/ForestryMC): Finds items inside backpacks when inside another container.
|
||||||
|
* [ProjectRedExploration](https://github.com/GTNewHorizons/ProjectRed): Finds items inside backpacks when inside another container.
|
||||||
|
* [Draconic Evolution](https://github.com/GTNewHorizons/Draconic-Evolution/): Finds placed items.
|
||||||
|
* [Thaumcraft 4](https://www.curseforge.com/minecraft/mc-mods/thaumcraft/files/2227552): Finds essentia in placed containers.
|
||||||
|
* [Aspect Recipe Index](https://github.com/GTNewHorizons/AspectRecipeIndex): Also finds essentia when trying to "find" its aspect items.
|
||||||
|
* [Thaumcraft NEI Plugin](https://www.curseforge.com/minecraft/mc-mods/thaumcraft-nei-plugin) Also finds essentia when trying to "find" its aspect items.
|
||||||
+2
-719
@@ -1,722 +1,5 @@
|
|||||||
//version: 1644349045
|
//version: 1707058017
|
||||||
/*
|
|
||||||
DO NOT CHANGE THIS FILE!
|
|
||||||
|
|
||||||
Also, you may replace this file at any time if there is an update available.
|
|
||||||
Please check https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/build.gradle for updates.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
|
|
||||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
|
||||||
|
|
||||||
import java.util.concurrent.TimeUnit
|
|
||||||
|
|
||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
maven {
|
|
||||||
name = "forge"
|
|
||||||
url = "https://maven.minecraftforge.net"
|
|
||||||
}
|
|
||||||
maven {
|
|
||||||
name = "sonatype"
|
|
||||||
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
|
||||||
}
|
|
||||||
maven {
|
|
||||||
name = "Scala CI dependencies"
|
|
||||||
url = "https://repo1.maven.org/maven2/"
|
|
||||||
}
|
|
||||||
maven {
|
|
||||||
name = "jitpack"
|
|
||||||
url = "https://jitpack.io"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dependencies {
|
|
||||||
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.7'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'idea'
|
id 'com.gtnewhorizons.gtnhconvention'
|
||||||
id 'eclipse'
|
|
||||||
id 'scala'
|
|
||||||
id 'maven-publish'
|
|
||||||
id('org.jetbrains.kotlin.jvm') version ('1.6.10') apply false
|
|
||||||
id('org.ajoberstar.grgit') version('4.1.1')
|
|
||||||
id('com.github.johnrengelman.shadow') version('4.0.4')
|
|
||||||
id('com.palantir.git-version') version('0.13.0') apply false
|
|
||||||
id('de.undercouch.download') version('5.0.1')
|
|
||||||
}
|
|
||||||
|
|
||||||
if (project.file('.git/HEAD').isFile()) {
|
|
||||||
apply plugin: 'com.palantir.git-version'
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'forge'
|
|
||||||
|
|
||||||
def projectJavaVersion = JavaLanguageVersion.of(8)
|
|
||||||
|
|
||||||
java {
|
|
||||||
toolchain {
|
|
||||||
languageVersion.set(projectJavaVersion)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
idea {
|
|
||||||
module {
|
|
||||||
inheritOutputDirs = true
|
|
||||||
downloadJavadoc = true
|
|
||||||
downloadSources = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(JavaVersion.current() != JavaVersion.VERSION_1_8) {
|
|
||||||
throw new GradleException("This project requires Java 8, but it's running on " + JavaVersion.current())
|
|
||||||
}
|
|
||||||
|
|
||||||
checkPropertyExists("modName")
|
|
||||||
checkPropertyExists("modId")
|
|
||||||
checkPropertyExists("modGroup")
|
|
||||||
checkPropertyExists("autoUpdateBuildScript")
|
|
||||||
checkPropertyExists("minecraftVersion")
|
|
||||||
checkPropertyExists("forgeVersion")
|
|
||||||
checkPropertyExists("replaceGradleTokenInFile")
|
|
||||||
checkPropertyExists("gradleTokenModId")
|
|
||||||
checkPropertyExists("gradleTokenModName")
|
|
||||||
checkPropertyExists("gradleTokenVersion")
|
|
||||||
checkPropertyExists("gradleTokenGroupName")
|
|
||||||
checkPropertyExists("apiPackage")
|
|
||||||
checkPropertyExists("accessTransformersFile")
|
|
||||||
checkPropertyExists("usesMixins")
|
|
||||||
checkPropertyExists("mixinPlugin")
|
|
||||||
checkPropertyExists("mixinsPackage")
|
|
||||||
checkPropertyExists("coreModClass")
|
|
||||||
checkPropertyExists("containsMixinsAndOrCoreModOnly")
|
|
||||||
checkPropertyExists("usesShadowedDependencies")
|
|
||||||
checkPropertyExists("developmentEnvironmentUserName")
|
|
||||||
|
|
||||||
boolean noPublishedSources = project.findProperty("noPublishedSources") ? project.noPublishedSources.toBoolean() : false
|
|
||||||
|
|
||||||
String javaSourceDir = "src/main/java/"
|
|
||||||
String scalaSourceDir = "src/main/scala/"
|
|
||||||
String kotlinSourceDir = "src/main/kotlin/"
|
|
||||||
|
|
||||||
String targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/")
|
|
||||||
String targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/")
|
|
||||||
String targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/")
|
|
||||||
if(!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) {
|
|
||||||
throw new GradleException("Could not resolve \"modGroup\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin)
|
|
||||||
}
|
|
||||||
|
|
||||||
if(apiPackage) {
|
|
||||||
targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/")
|
|
||||||
targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/")
|
|
||||||
targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/")
|
|
||||||
if(!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) {
|
|
||||||
throw new GradleException("Could not resolve \"apiPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(accessTransformersFile) {
|
|
||||||
String targetFile = "src/main/resources/META-INF/" + accessTransformersFile
|
|
||||||
if(!getFile(targetFile).exists()) {
|
|
||||||
throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(usesMixins.toBoolean()) {
|
|
||||||
if(mixinsPackage.isEmpty() || mixinPlugin.isEmpty()) {
|
|
||||||
throw new GradleException("\"mixinPlugin\" requires \"mixinsPackage\" and \"mixinPlugin\" to be set!")
|
|
||||||
}
|
|
||||||
|
|
||||||
targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
|
|
||||||
targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
|
|
||||||
targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
|
|
||||||
if(!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) {
|
|
||||||
throw new GradleException("Could not resolve \"mixinsPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin)
|
|
||||||
}
|
|
||||||
|
|
||||||
String targetFileJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".java"
|
|
||||||
String targetFileScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".scala"
|
|
||||||
String targetFileScalaJava = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".java"
|
|
||||||
String targetFileKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".kt"
|
|
||||||
if(!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) {
|
|
||||||
throw new GradleException("Could not resolve \"mixinPlugin\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(coreModClass) {
|
|
||||||
String targetFileJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".java"
|
|
||||||
String targetFileScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".scala"
|
|
||||||
String targetFileScalaJava = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".java"
|
|
||||||
String targetFileKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".kt"
|
|
||||||
if(!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) {
|
|
||||||
throw new GradleException("Could not resolve \"coreModClass\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
configurations.all {
|
|
||||||
resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS)
|
|
||||||
|
|
||||||
// Make sure GregTech build won't time out
|
|
||||||
System.setProperty("org.gradle.internal.http.connectionTimeout", 120000 as String)
|
|
||||||
System.setProperty("org.gradle.internal.http.socketTimeout", 120000 as String)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fix Jenkins' Git: chmod a file should not be detected as a change and append a '.dirty' to the version
|
|
||||||
try {
|
|
||||||
'git config core.fileMode false'.execute()
|
|
||||||
}
|
|
||||||
catch (Exception e) {
|
|
||||||
logger.error("\u001B[31mgit isn't installed at all\u001B[0m")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pulls version first from the VERSION env and then git tag
|
|
||||||
String identifiedVersion
|
|
||||||
String versionOverride = System.getenv("VERSION") ?: null
|
|
||||||
try {
|
|
||||||
identifiedVersion = versionOverride == null ? gitVersion() : versionOverride
|
|
||||||
}
|
|
||||||
catch (Exception e) {
|
|
||||||
logger.error("\n\u001B[1;31mThis mod must be version controlled by Git AND the repository must provide at least one tag,\n" +
|
|
||||||
"or the VERSION override must be set! \u001B[32m(Don't download from GitHub using the ZIP option, instead\n" +
|
|
||||||
"clone the repository, see\u001B[33m https://gtnh.miraheze.org/wiki/Development \u001B[32mfor details.)\u001B[0m\n");
|
|
||||||
versionOverride = 'NO-GIT-TAG-SET'
|
|
||||||
identifiedVersion = versionOverride
|
|
||||||
}
|
|
||||||
version = minecraftVersion + '-' + identifiedVersion
|
|
||||||
String modVersion = identifiedVersion
|
|
||||||
|
|
||||||
if( identifiedVersion.equals(versionOverride) ) {
|
|
||||||
logger.error('\u001B[31m\u001B[7mWe hope you know what you\'re doing using\u001B[0m\u001B[1;34m ' + modVersion + '\u001B[0m\n');
|
|
||||||
logger.error('\7\u001B[31mGoing to blindly try to use\u001B[1;34m ' + modVersion + '\u001B[0m\u001B[31m, this probably won\'t work the way you expect!!\u001B[0m\n');
|
|
||||||
}
|
|
||||||
|
|
||||||
group = modGroup
|
|
||||||
if(project.hasProperty("customArchiveBaseName") && customArchiveBaseName) {
|
|
||||||
archivesBaseName = customArchiveBaseName
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
archivesBaseName = modId
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def arguments = []
|
|
||||||
def jvmArguments = []
|
|
||||||
|
|
||||||
if(usesMixins.toBoolean()) {
|
|
||||||
arguments += [
|
|
||||||
"--tweakClass org.spongepowered.asm.launch.MixinTweaker"
|
|
||||||
]
|
|
||||||
jvmArguments += [
|
|
||||||
"-Dmixin.debug.countInjections=true", "-Dmixin.debug.verbose=true", "-Dmixin.debug.export=true"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
minecraft {
|
|
||||||
version = minecraftVersion + "-" + forgeVersion + "-" + minecraftVersion
|
|
||||||
runDir = "run"
|
|
||||||
|
|
||||||
if (replaceGradleTokenInFile) {
|
|
||||||
replaceIn replaceGradleTokenInFile
|
|
||||||
if(gradleTokenModId) {
|
|
||||||
replace gradleTokenModId, modId
|
|
||||||
}
|
|
||||||
if(gradleTokenModName) {
|
|
||||||
replace gradleTokenModName, modName
|
|
||||||
}
|
|
||||||
if(gradleTokenVersion) {
|
|
||||||
replace gradleTokenVersion, modVersion
|
|
||||||
}
|
|
||||||
if(gradleTokenGroupName) {
|
|
||||||
replace gradleTokenGroupName, modGroup
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
clientIntellijRun {
|
|
||||||
args(arguments)
|
|
||||||
jvmArgs(jvmArguments)
|
|
||||||
|
|
||||||
if(developmentEnvironmentUserName) {
|
|
||||||
args("--username", developmentEnvironmentUserName)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
serverIntellijRun {
|
|
||||||
args(arguments)
|
|
||||||
jvmArgs(jvmArguments)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(file("addon.gradle").exists()) {
|
|
||||||
apply from: "addon.gradle"
|
|
||||||
}
|
|
||||||
|
|
||||||
apply from: 'repositories.gradle'
|
|
||||||
|
|
||||||
configurations {
|
|
||||||
implementation.extendsFrom(shadowImplementation) // TODO: remove after all uses are refactored
|
|
||||||
implementation.extendsFrom(shadowCompile)
|
|
||||||
implementation.extendsFrom(shadeCompile)
|
|
||||||
}
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
maven {
|
|
||||||
name = "Overmind forge repo mirror"
|
|
||||||
url = "https://gregtech.overminddl1.com/"
|
|
||||||
}
|
|
||||||
if(usesMixins.toBoolean()) {
|
|
||||||
maven {
|
|
||||||
name = "sponge"
|
|
||||||
url = "https://repo.spongepowered.org/repository/maven-public"
|
|
||||||
}
|
|
||||||
maven {
|
|
||||||
url = "https://jitpack.io"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
if(usesMixins.toBoolean()) {
|
|
||||||
annotationProcessor("org.ow2.asm:asm-debug-all:5.0.3")
|
|
||||||
annotationProcessor("com.google.guava:guava:24.1.1-jre")
|
|
||||||
annotationProcessor("com.google.code.gson:gson:2.8.6")
|
|
||||||
annotationProcessor("org.spongepowered:mixin:0.8-SNAPSHOT")
|
|
||||||
// using 0.8 to workaround a issue in 0.7 which fails mixin application
|
|
||||||
compile("com.github.GTNewHorizons:SpongePoweredMixin:0.7.12-GTNH") {
|
|
||||||
// Mixin includes a lot of dependencies that are too up-to-date
|
|
||||||
exclude module: "launchwrapper"
|
|
||||||
exclude module: "guava"
|
|
||||||
exclude module: "gson"
|
|
||||||
exclude module: "commons-io"
|
|
||||||
exclude module: "log4j-core"
|
|
||||||
}
|
|
||||||
compile("com.github.GTNewHorizons:SpongeMixins:1.5.0")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
apply from: 'dependencies.gradle'
|
|
||||||
|
|
||||||
def mixingConfigRefMap = "mixins." + modId + ".refmap.json"
|
|
||||||
def refMap = "${tasks.compileJava.temporaryDir}" + File.separator + mixingConfigRefMap
|
|
||||||
def mixinSrg = "${tasks.reobf.temporaryDir}" + File.separator + "mixins.srg"
|
|
||||||
|
|
||||||
task generateAssets {
|
|
||||||
if(usesMixins.toBoolean()) {
|
|
||||||
getFile("/src/main/resources/mixins." + modId + ".json").text = """{
|
|
||||||
"required": true,
|
|
||||||
"minVersion": "0.7.11",
|
|
||||||
"package": "${modGroup}.${mixinsPackage}",
|
|
||||||
"plugin": "${modGroup}.${mixinPlugin}",
|
|
||||||
"refmap": "${mixingConfigRefMap}",
|
|
||||||
"target": "@env(DEFAULT)",
|
|
||||||
"compatibilityLevel": "JAVA_8"
|
|
||||||
}
|
|
||||||
|
|
||||||
"""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
task relocateShadowJar(type: ConfigureShadowRelocation) {
|
|
||||||
target = tasks.shadowJar
|
|
||||||
prefix = modGroup + ".shadow"
|
|
||||||
}
|
|
||||||
|
|
||||||
shadowJar {
|
|
||||||
project.configurations.shadeCompile.each { dep ->
|
|
||||||
from(project.zipTree(dep)) {
|
|
||||||
exclude 'META-INF', 'META-INF/**'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
manifest {
|
|
||||||
attributes(getManifestAttributes())
|
|
||||||
}
|
|
||||||
|
|
||||||
minimize() // This will only allow shading for actually used classes
|
|
||||||
configurations = [project.configurations.shadowImplementation, project.configurations.shadowCompile]
|
|
||||||
dependsOn(relocateShadowJar)
|
|
||||||
}
|
|
||||||
|
|
||||||
jar {
|
|
||||||
project.configurations.shadeCompile.each { dep ->
|
|
||||||
from(project.zipTree(dep)) {
|
|
||||||
exclude 'META-INF', 'META-INF/**'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
manifest {
|
|
||||||
attributes(getManifestAttributes())
|
|
||||||
}
|
|
||||||
|
|
||||||
if(usesShadowedDependencies.toBoolean()) {
|
|
||||||
dependsOn(shadowJar)
|
|
||||||
enabled = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
reobf {
|
|
||||||
if(usesMixins.toBoolean()) {
|
|
||||||
addExtraSrgFile mixinSrg
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
afterEvaluate {
|
|
||||||
if(usesMixins.toBoolean()) {
|
|
||||||
tasks.compileJava {
|
|
||||||
options.compilerArgs += [
|
|
||||||
"-AreobfSrgFile=${tasks.reobf.srg}",
|
|
||||||
"-AoutSrgFile=${mixinSrg}",
|
|
||||||
"-AoutRefMapFile=${refMap}",
|
|
||||||
// Elan: from what I understand they are just some linter configs so you get some warning on how to properly code
|
|
||||||
"-XDenableSunApiLintControl",
|
|
||||||
"-XDignore.symbol.file"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
runClient {
|
|
||||||
if(developmentEnvironmentUserName) {
|
|
||||||
arguments += [
|
|
||||||
"--username",
|
|
||||||
developmentEnvironmentUserName
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
args(arguments)
|
|
||||||
jvmArgs(jvmArguments)
|
|
||||||
}
|
|
||||||
|
|
||||||
runServer {
|
|
||||||
args(arguments)
|
|
||||||
jvmArgs(jvmArguments)
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType(JavaExec).configureEach {
|
|
||||||
javaLauncher.set(
|
|
||||||
javaToolchains.launcherFor {
|
|
||||||
languageVersion = projectJavaVersion
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
processResources
|
|
||||||
{
|
|
||||||
// this will ensure that this task is redone when the versions change.
|
|
||||||
inputs.property "version", project.version
|
|
||||||
inputs.property "mcversion", project.minecraft.version
|
|
||||||
|
|
||||||
// replace stuff in mcmod.info, nothing else
|
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
|
||||||
include 'mcmod.info'
|
|
||||||
|
|
||||||
// replace modVersion and minecraftVersion
|
|
||||||
expand "minecraftVersion": project.minecraft.version,
|
|
||||||
"modVersion": modVersion,
|
|
||||||
"modId": modId,
|
|
||||||
"modName": modName
|
|
||||||
}
|
|
||||||
|
|
||||||
if(usesMixins.toBoolean()) {
|
|
||||||
from refMap
|
|
||||||
}
|
|
||||||
|
|
||||||
// copy everything else that's not the mcmod.info
|
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
|
||||||
exclude 'mcmod.info'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def getManifestAttributes() {
|
|
||||||
def manifestAttributes = [:]
|
|
||||||
if(containsMixinsAndOrCoreModOnly.toBoolean() == false && (usesMixins.toBoolean() || coreModClass)) {
|
|
||||||
manifestAttributes += ["FMLCorePluginContainsFMLMod": true]
|
|
||||||
}
|
|
||||||
|
|
||||||
if(accessTransformersFile) {
|
|
||||||
manifestAttributes += ["FMLAT" : accessTransformersFile.toString()]
|
|
||||||
}
|
|
||||||
|
|
||||||
if(coreModClass) {
|
|
||||||
manifestAttributes += ["FMLCorePlugin": modGroup + "." + coreModClass]
|
|
||||||
}
|
|
||||||
|
|
||||||
if(usesMixins.toBoolean()) {
|
|
||||||
manifestAttributes += [
|
|
||||||
"TweakClass" : "org.spongepowered.asm.launch.MixinTweaker",
|
|
||||||
"MixinConfigs" : "mixins." + modId + ".json",
|
|
||||||
"ForceLoadAsMod" : containsMixinsAndOrCoreModOnly.toBoolean() == false
|
|
||||||
]
|
|
||||||
}
|
|
||||||
return manifestAttributes
|
|
||||||
}
|
|
||||||
|
|
||||||
task sourcesJar(type: Jar) {
|
|
||||||
from (sourceSets.main.allJava)
|
|
||||||
from (file("$projectDir/LICENSE"))
|
|
||||||
getArchiveClassifier().set('sources')
|
|
||||||
}
|
|
||||||
|
|
||||||
task shadowDevJar(type: ShadowJar) {
|
|
||||||
project.configurations.shadeCompile.each { dep ->
|
|
||||||
from(project.zipTree(dep)) {
|
|
||||||
exclude 'META-INF', 'META-INF/**'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
from sourceSets.main.output
|
|
||||||
getArchiveClassifier().set("dev")
|
|
||||||
|
|
||||||
manifest {
|
|
||||||
attributes(getManifestAttributes())
|
|
||||||
}
|
|
||||||
|
|
||||||
minimize() // This will only allow shading for actually used classes
|
|
||||||
configurations = [project.configurations.shadowImplementation, project.configurations.shadowCompile]
|
|
||||||
}
|
|
||||||
|
|
||||||
task relocateShadowDevJar(type: ConfigureShadowRelocation) {
|
|
||||||
target = tasks.shadowDevJar
|
|
||||||
prefix = modGroup + ".shadow"
|
|
||||||
}
|
|
||||||
|
|
||||||
task circularResolverJar(type: Jar) {
|
|
||||||
dependsOn(relocateShadowDevJar)
|
|
||||||
dependsOn(shadowDevJar)
|
|
||||||
enabled = false
|
|
||||||
}
|
|
||||||
|
|
||||||
task devJar(type: Jar) {
|
|
||||||
project.configurations.shadeCompile.each { dep ->
|
|
||||||
from(project.zipTree(dep)) {
|
|
||||||
exclude 'META-INF', 'META-INF/**'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
from sourceSets.main.output
|
|
||||||
getArchiveClassifier().set("dev")
|
|
||||||
|
|
||||||
manifest {
|
|
||||||
attributes(getManifestAttributes())
|
|
||||||
}
|
|
||||||
|
|
||||||
if(usesShadowedDependencies.toBoolean()) {
|
|
||||||
dependsOn(circularResolverJar)
|
|
||||||
enabled = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
task apiJar(type: Jar) {
|
|
||||||
from (sourceSets.main.allJava) {
|
|
||||||
include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**'
|
|
||||||
}
|
|
||||||
|
|
||||||
from (sourceSets.main.output) {
|
|
||||||
include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**'
|
|
||||||
}
|
|
||||||
|
|
||||||
from (sourceSets.main.resources.srcDirs) {
|
|
||||||
include("LICENSE")
|
|
||||||
}
|
|
||||||
|
|
||||||
getArchiveClassifier().set('api')
|
|
||||||
}
|
|
||||||
|
|
||||||
artifacts {
|
|
||||||
if(!noPublishedSources) {
|
|
||||||
archives sourcesJar
|
|
||||||
}
|
|
||||||
archives devJar
|
|
||||||
if(apiPackage) {
|
|
||||||
archives apiJar
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// The gradle metadata includes all of the additional deps that we disabled from POM generation (including forgeBin with no groupID),
|
|
||||||
// and isn't strictly needed with the POM so just disable it.
|
|
||||||
tasks.withType(GenerateModuleMetadata) {
|
|
||||||
enabled = false
|
|
||||||
}
|
|
||||||
|
|
||||||
publishing {
|
|
||||||
publications {
|
|
||||||
maven(MavenPublication) {
|
|
||||||
from components.java
|
|
||||||
if(usesShadowedDependencies.toBoolean()) {
|
|
||||||
artifact source: shadowJar, classifier: ""
|
|
||||||
}
|
|
||||||
if(!noPublishedSources) {
|
|
||||||
artifact source: sourcesJar, classifier: "src"
|
|
||||||
}
|
|
||||||
artifact source: usesShadowedDependencies.toBoolean() ? shadowDevJar : devJar, classifier: "dev"
|
|
||||||
if (apiPackage) {
|
|
||||||
artifact source: apiJar, classifier: "api"
|
|
||||||
}
|
|
||||||
|
|
||||||
groupId = System.getenv("ARTIFACT_GROUP_ID") ?: "com.github.GTNewHorizons"
|
|
||||||
artifactId = System.getenv("ARTIFACT_ID") ?: project.name
|
|
||||||
// Using the identified version, not project.version as it has the prepended 1.7.10
|
|
||||||
version = System.getenv("RELEASE_VERSION") ?: identifiedVersion
|
|
||||||
|
|
||||||
// remove extra garbage from who knows where
|
|
||||||
pom.withXml {
|
|
||||||
def badPomGroup = ['net.minecraft', 'com.google.code.findbugs', 'org.ow2.asm', 'com.typesafe.akka', 'com.typesafe', 'org.scala-lang',
|
|
||||||
'org.scala-lang.plugins', 'net.sf.jopt-simple', 'lzma', 'com.mojang', 'org.apache.commons', 'org.apache.httpcomponents',
|
|
||||||
'commons-logging', 'java3d', 'net.sf.trove4j', 'com.ibm.icu', 'com.paulscode', 'io.netty', 'com.google.guava',
|
|
||||||
'commons-io', 'commons-codec', 'net.java.jinput', 'net.java.jutils', 'com.google.code.gson', 'org.apache.logging.log4j',
|
|
||||||
'org.lwjgl.lwjgl', 'tv.twitch', '']
|
|
||||||
Node pomNode = asNode()
|
|
||||||
pomNode.dependencies.'*'.findAll() {
|
|
||||||
badPomGroup.contains(it.groupId.text())
|
|
||||||
}.each() {
|
|
||||||
it.parent().remove(it)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
maven {
|
|
||||||
url = "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases"
|
|
||||||
credentials {
|
|
||||||
username = System.getenv("MAVEN_USER") ?: "NONE"
|
|
||||||
password = System.getenv("MAVEN_PASSWORD") ?: "NONE"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Updating
|
|
||||||
task updateBuildScript {
|
|
||||||
doLast {
|
|
||||||
if (performBuildScriptUpdate(projectDir.toString())) return
|
|
||||||
|
|
||||||
print("Build script already up-to-date!")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isNewBuildScriptVersionAvailable(projectDir.toString())) {
|
|
||||||
if (autoUpdateBuildScript.toBoolean()) {
|
|
||||||
performBuildScriptUpdate(projectDir.toString())
|
|
||||||
} else {
|
|
||||||
println("Build script update available! Run 'gradle updateBuildScript'")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static URL availableBuildScriptUrl() {
|
|
||||||
new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/main/build.gradle")
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean performBuildScriptUpdate(String projectDir) {
|
|
||||||
if (isNewBuildScriptVersionAvailable(projectDir)) {
|
|
||||||
def buildscriptFile = getFile("build.gradle")
|
|
||||||
availableBuildScriptUrl().withInputStream { i -> buildscriptFile.withOutputStream { it << i } }
|
|
||||||
print("Build script updated. Please REIMPORT the project or RESTART your IDE!")
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean isNewBuildScriptVersionAvailable(String projectDir) {
|
|
||||||
Map parameters = ["connectTimeout": 2000, "readTimeout": 2000]
|
|
||||||
|
|
||||||
String currentBuildScript = getFile("build.gradle").getText()
|
|
||||||
String currentBuildScriptHash = getVersionHash(currentBuildScript)
|
|
||||||
String availableBuildScript = availableBuildScriptUrl().newInputStream(parameters).getText()
|
|
||||||
String availableBuildScriptHash = getVersionHash(availableBuildScript)
|
|
||||||
|
|
||||||
boolean isUpToDate = currentBuildScriptHash.empty || availableBuildScriptHash.empty || currentBuildScriptHash == availableBuildScriptHash
|
|
||||||
return !isUpToDate
|
|
||||||
}
|
|
||||||
|
|
||||||
static String getVersionHash(String buildScriptContent) {
|
|
||||||
String versionLine = buildScriptContent.find("^//version: [a-z0-9]*")
|
|
||||||
if(versionLine != null) {
|
|
||||||
return versionLine.split(": ").last()
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
configure(updateBuildScript) {
|
|
||||||
group = 'forgegradle'
|
|
||||||
description = 'Updates the build script to the latest version'
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deobfuscation
|
|
||||||
|
|
||||||
def deobf(String sourceURL) {
|
|
||||||
try {
|
|
||||||
URL url = new URL(sourceURL)
|
|
||||||
String fileName = url.getFile()
|
|
||||||
|
|
||||||
//get rid of directories:
|
|
||||||
int lastSlash = fileName.lastIndexOf("/")
|
|
||||||
if(lastSlash > 0) {
|
|
||||||
fileName = fileName.substring(lastSlash + 1)
|
|
||||||
}
|
|
||||||
//get rid of extension:
|
|
||||||
if(fileName.endsWith(".jar")) {
|
|
||||||
fileName = fileName.substring(0, fileName.lastIndexOf("."))
|
|
||||||
}
|
|
||||||
|
|
||||||
String hostName = url.getHost()
|
|
||||||
if(hostName.startsWith("www.")) {
|
|
||||||
hostName = hostName.substring(4)
|
|
||||||
}
|
|
||||||
List parts = Arrays.asList(hostName.split("\\."))
|
|
||||||
Collections.reverse(parts)
|
|
||||||
hostName = String.join(".", parts)
|
|
||||||
|
|
||||||
return deobf(sourceURL, hostName + "/" + fileName)
|
|
||||||
} catch(Exception e) {
|
|
||||||
return deobf(sourceURL, "deobf/" + String.valueOf(sourceURL.hashCode()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// The method above is to be preferred. Use this method if the filename is not at the end of the URL.
|
|
||||||
def deobf(String sourceURL, String fileName) {
|
|
||||||
String cacheDir = System.getProperty("user.home") + "/.gradle/caches/"
|
|
||||||
String bon2Dir = cacheDir + "forge_gradle/deobf"
|
|
||||||
String bon2File = bon2Dir + "/BON2-2.5.0.jar"
|
|
||||||
String obfFile = cacheDir + "modules-2/files-2.1/" + fileName + ".jar"
|
|
||||||
String deobfFile = cacheDir + "modules-2/files-2.1/" + fileName + "-deobf.jar"
|
|
||||||
|
|
||||||
if(file(deobfFile).exists()) {
|
|
||||||
return files(deobfFile)
|
|
||||||
}
|
|
||||||
|
|
||||||
download.run {
|
|
||||||
src 'https://github.com/GTNewHorizons/BON2/releases/download/2.5.0/BON2-2.5.0.CUSTOM-all.jar'
|
|
||||||
dest bon2File
|
|
||||||
quiet true
|
|
||||||
overwrite false
|
|
||||||
}
|
|
||||||
|
|
||||||
download.run {
|
|
||||||
src sourceURL
|
|
||||||
dest obfFile
|
|
||||||
quiet true
|
|
||||||
overwrite false
|
|
||||||
}
|
|
||||||
|
|
||||||
exec {
|
|
||||||
commandLine 'java', '-jar', bon2File, '--inputJar', obfFile, '--outputJar', deobfFile, '--mcVer', '1.7.10', '--mappingsVer', 'stable_12', '--notch'
|
|
||||||
workingDir bon2Dir
|
|
||||||
standardOutput = new ByteArrayOutputStream()
|
|
||||||
}
|
|
||||||
|
|
||||||
return files(deobfFile)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Helper methods
|
|
||||||
|
|
||||||
def checkPropertyExists(String propertyName) {
|
|
||||||
if (project.hasProperty(propertyName) == false) {
|
|
||||||
throw new GradleException("This project requires a property \"" + propertyName + "\"! Please add it your \"gradle.properties\". You can find all properties and their description here: https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/gradle.properties")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def getFile(String relativePath) {
|
|
||||||
return new File(projectDir, relativePath)
|
|
||||||
}
|
}
|
||||||
+23
-2
@@ -1,6 +1,27 @@
|
|||||||
// Add your dependencies here
|
// Add your dependencies here
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile('com.github.GTNewHorizons:NotEnoughItems:2.2.27-GTNH:dev')
|
implementation("com.github.GTNewHorizons:NotEnoughItems:2.8.121-GTNH:dev")
|
||||||
compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.40.33:dev')
|
implementation("com.github.GTNewHorizons:GTNHLib:0.11.37:dev")
|
||||||
|
|
||||||
|
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.54.80:dev")
|
||||||
|
compileOnly("com.github.GTNewHorizons:EnderIO:2.10.36:dev")
|
||||||
|
compileOnly("com.github.GTNewHorizons:Draconic-Evolution:1.5.31-GTNH:dev")
|
||||||
|
compileOnly("com.github.GTNewHorizons:ForestryMC:4.11.34:dev")
|
||||||
|
compileOnly("com.github.GTNewHorizons:AdventureBackpack2:1.4.23-GTNH:dev")
|
||||||
|
compileOnly("com.github.GTNewHorizons:ProjectRed:4.12.41-GTNH:dev")
|
||||||
|
compileOnly("com.github.GTNewHorizons:Minecraft-Backpack-Mod:2.6.16-GTNH:dev")
|
||||||
|
compileOnly("curse.maven:thaumcraft-nei-plugin-225095:2241913")
|
||||||
|
compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev")
|
||||||
|
compileOnly("com.github.GTNewHorizons:AspectRecipeIndex:1.1.3:dev")
|
||||||
|
compileOnly("net.xonich.mc:NoHotbarNeeded:0.0.3:dev")
|
||||||
|
|
||||||
|
// For testing in dev environment.
|
||||||
|
// runtimeOnlyNonPublishable("com.github.GTNewHorizons:StorageDrawers:2.2.28-GTNH")
|
||||||
|
// runtimeOnlyNonPublishable("com.github.GTNewHorizons:waila:1.19.31")
|
||||||
|
// runtimeOnlyNonPublishable("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev")
|
||||||
|
// runtimeOnlyNonPublishable("com.github.GTNewHorizons:Baubles-Expanded:2.2.22-GTNH:dev")
|
||||||
|
// runtimeOnlyNonPublishable(rfg.deobf("curse.maven:thaumcraft-nei-plugin-225095:2241913"))
|
||||||
|
// runtimeOnlyNonPublishable("com.github.GTNewHorizons:AspectRecipeIndex:1.1.3:dev")
|
||||||
|
|
||||||
}
|
}
|
||||||
+200
-29
@@ -1,67 +1,238 @@
|
|||||||
|
# ExampleMod tag to use as Blowdryer (Spotless, etc.) settings version, leave empty to disable.
|
||||||
|
# LOCAL to test local config updates.
|
||||||
|
gtnh.settings.blowdryerTag = 0.2.0
|
||||||
|
|
||||||
|
# Human-readable mod name, available for mcmod.info population.
|
||||||
modName = FindIt
|
modName = FindIt
|
||||||
|
|
||||||
# This is a case-sensitive string to identify your mod. Convention is to use lower case.
|
# Case-sensitive identifier string, available for mcmod.info population and used for automatic mixin JSON generation.
|
||||||
|
# Conventionally lowercase.
|
||||||
modId = findit
|
modId = findit
|
||||||
|
|
||||||
modGroup = com.gtnh
|
# Root package of the mod, used to find various classes in other properties,
|
||||||
|
# mcmod.info substitution, enabling assertions in run tasks, etc.
|
||||||
|
modGroup = com.gtnh.findit
|
||||||
|
|
||||||
# WHY is there no version field?
|
# Whether to use modGroup as the maven publishing group.
|
||||||
# The build script relies on git to provide a version via tags. It is super easy and will enable you to always know the
|
# When false, com.github.GTNewHorizons is used.
|
||||||
# code base or your binary. Check out this tutorial: https://blog.mattclemente.com/2017/10/13/versioning-with-git-tags/
|
useModGroupForPublishing = false
|
||||||
|
|
||||||
# Will update your build.gradle automatically whenever an update is available
|
# Updates your build.gradle and settings.gradle automatically whenever an update is available.
|
||||||
autoUpdateBuildScript = false
|
autoUpdateBuildScript = false
|
||||||
|
|
||||||
|
# Version of Minecraft to target
|
||||||
minecraftVersion = 1.7.10
|
minecraftVersion = 1.7.10
|
||||||
|
|
||||||
|
# Version of Minecraft Forge to target
|
||||||
forgeVersion = 10.13.4.1614
|
forgeVersion = 10.13.4.1614
|
||||||
|
|
||||||
# Select a username for testing your mod with breakpoints. You may leave this empty for a random username each time you
|
# Specify an MCP channel for dependency deobfuscation and the deobfParams task.
|
||||||
# restart Minecraft in development. Choose this dependent on your mod:
|
channel = stable
|
||||||
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
|
|
||||||
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
|
# Specify an MCP mappings version for dependency deobfuscation and the deobfParams task.
|
||||||
|
mappingsVersion = 12
|
||||||
|
|
||||||
|
# Defines other MCP mappings for dependency deobfuscation.
|
||||||
|
remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/
|
||||||
|
|
||||||
|
# Select a default username for testing your mod. You can always override this per-run by running
|
||||||
|
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
|
||||||
developmentEnvironmentUserName = Developer
|
developmentEnvironmentUserName = Developer
|
||||||
|
|
||||||
# Define a source file of your project with:
|
# Enables modern Java syntax support. Valid values:
|
||||||
|
# - false: No modern syntax, Java 8 only
|
||||||
|
# - jabel: Jabel syntax-only support, compiles to J8 bytecode
|
||||||
|
# - jvmDowngrader: Full modern Java via JVM Downgrader (syntax + stdlib APIs)
|
||||||
|
# - modern: Native modern Java bytecode, no downgrading
|
||||||
|
enableModernJavaSyntax = jabel
|
||||||
|
|
||||||
|
# If set, ignores the above setting and compiles with the given toolchain. This may cause unexpected issues,
|
||||||
|
# and should *not* be used in most situations. -1 disables this.
|
||||||
|
# forceToolchainVersion = -1
|
||||||
|
|
||||||
|
# Target JVM version for JVM Downgrader bytecode downgrading.
|
||||||
|
# Only used when enableModernJavaSyntax = jvmDowngrader
|
||||||
|
# downgradeTargetVersion = 8
|
||||||
|
|
||||||
|
# Comma-separated list of Java versions for multi-release jar support (JVM Downgrader only).
|
||||||
|
# Classes will be available in META-INF/versions/N/ for each version N in this list.
|
||||||
|
# Default: "21,25" (J25+ gets native classes, J21-24 gets partial downgrade, J8-20 gets full downgrade).
|
||||||
|
# jvmDowngraderMultiReleaseVersions = 21,25
|
||||||
|
|
||||||
|
# Specifies how JVM Downgrader API stubs are provided. Options:
|
||||||
|
# - shade: Shade minimized stubs into the jar
|
||||||
|
# - gtnhlib: GTNHLib provides stubs at runtime (adds version constraint)
|
||||||
|
# - external: Another dependency provides stubs (no constraint, no warning)
|
||||||
|
# - (empty): Warning reminding you to configure stubs
|
||||||
|
# Note: 'shade' option requires you to verify license compliance, see: https://github.com/unimined/JvmDowngrader/blob/main/LICENSE.md
|
||||||
|
# jvmDowngraderStubsProvider =
|
||||||
|
|
||||||
|
# Enables injecting missing generics into the decompiled source code for a better coding experience.
|
||||||
|
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
|
||||||
|
enableGenericInjection = false
|
||||||
|
|
||||||
|
# Generate a class with a String field for the mod version named as defined below.
|
||||||
|
# If generateGradleTokenClass is empty or not missing, no such class will be generated.
|
||||||
|
# If gradleTokenVersion is empty or missing, the field will not be present in the class.
|
||||||
|
generateGradleTokenClass = com.gtnh.findit.Tags
|
||||||
|
|
||||||
|
# Name of the token containing the project's current version to generate/replace.
|
||||||
|
gradleTokenVersion = VERSION
|
||||||
|
|
||||||
|
# [DEPRECATED] Mod ID replacement token.
|
||||||
|
gradleTokenModId =
|
||||||
|
|
||||||
|
# [DEPRECATED] Mod name replacement token.
|
||||||
|
gradleTokenModName =
|
||||||
|
|
||||||
|
# [DEPRECATED] Mod Group replacement token.
|
||||||
|
gradleTokenGroupName =
|
||||||
|
|
||||||
|
# [DEPRECATED]
|
||||||
|
# Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java
|
||||||
# public static final String VERSION = "GRADLETOKEN_VERSION";
|
# public static final String VERSION = "GRADLETOKEN_VERSION";
|
||||||
# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's
|
# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's
|
||||||
# version in @Mod([...], version = VERSION, [...])
|
# version in @Mod([...], version = VERSION, [...]).
|
||||||
# Leave these properties empty to skip individual token replacements
|
# Leave these properties empty to skip individual token replacements.
|
||||||
replaceGradleTokenInFile = FindIt.java
|
replaceGradleTokenInFile =
|
||||||
gradleTokenModId = GRADLETOKEN_MODID
|
|
||||||
gradleTokenModName = GRADLETOKEN_MODNAME
|
|
||||||
gradleTokenVersion = GRADLETOKEN_VERSION
|
|
||||||
gradleTokenGroupName =
|
|
||||||
|
|
||||||
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
|
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
|
||||||
# leave this property empty.
|
# leave this property empty.
|
||||||
# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api
|
# Example value: (apiPackage = api) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.api
|
||||||
apiPackage =
|
apiPackage =
|
||||||
|
|
||||||
# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/
|
# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/
|
||||||
# Example value: mymodid_at.cfg
|
# There can be multiple files in a space-separated list.
|
||||||
|
# Example value: mymodid_at.cfg nei_at.cfg
|
||||||
accessTransformersFile = findit_at.cfg
|
accessTransformersFile = findit_at.cfg
|
||||||
|
|
||||||
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
||||||
usesMixins = false
|
usesMixins = false
|
||||||
|
|
||||||
|
# Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main.
|
||||||
|
# This can speed up compile times thanks to not running the mixin annotation processor on all input sources.
|
||||||
|
# Mixin classes will have access to "main" classes, but not the other way around.
|
||||||
|
separateMixinSourceSet =
|
||||||
|
|
||||||
|
# Adds some debug arguments like verbose output and class export.
|
||||||
|
usesMixinDebug = false
|
||||||
|
|
||||||
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
|
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
|
||||||
mixinPlugin =
|
mixinPlugin =
|
||||||
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
|
|
||||||
|
# Specify the package that contains all of your Mixins. The package must exist or
|
||||||
|
# the build will fail. If you have a package property defined in your mixins.<modid>.json,
|
||||||
|
# it must match with this or the build will fail.
|
||||||
mixinsPackage =
|
mixinsPackage =
|
||||||
|
|
||||||
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
|
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
|
||||||
# This parameter is for legacy compatibility only
|
# This parameter is for legacy compatibility only
|
||||||
# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin
|
# Example value: (coreModClass = asm.FMLPlugin) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.asm.FMLPlugin
|
||||||
coreModClass =
|
coreModClass =
|
||||||
|
|
||||||
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
|
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
|
||||||
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
|
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
|
||||||
containsMixinsAndOrCoreModOnly = false
|
containsMixinsAndOrCoreModOnly = false
|
||||||
|
|
||||||
# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated in your jar. It is your
|
# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins.
|
||||||
# responsibility check the licence and request permission for distribution, if required.
|
forceEnableMixins = false
|
||||||
|
|
||||||
|
# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated into your jar. It is your
|
||||||
|
# responsibility to check the license and request permission for distribution if required.
|
||||||
usesShadowedDependencies = false
|
usesShadowedDependencies = false
|
||||||
|
|
||||||
# Optional parameter to customize the produced artifacts. Use this to preserver artifact naming when migrating older
|
# If disabled, won't remove unused classes from shadowed dependencies. Some libraries use reflection to access
|
||||||
# projects. New projects should not use this parameter.
|
# their own classes, making the minimization unreliable.
|
||||||
#customArchiveBaseName =
|
minimizeShadowedDependencies = true
|
||||||
|
|
||||||
# Optional parameter to prevent the source code from being published
|
# If disabled, won't rename the shadowed classes.
|
||||||
# noPublishedSources =
|
relocateShadowedDependencies = true
|
||||||
|
|
||||||
|
# Adds CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
|
||||||
|
includeWellKnownRepositories = true
|
||||||
|
|
||||||
|
# A list of repositories to exclude from the includeWellKnownRepositories setting. Should be a space separated
|
||||||
|
# list of strings, with the acceptable keys being(case does not matter):
|
||||||
|
# cursemaven
|
||||||
|
# modrinth
|
||||||
|
excludeWellKnownRepositories =
|
||||||
|
|
||||||
|
# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
|
||||||
|
# Authenticate with the MAVEN_USER and MAVEN_PASSWORD environment variables.
|
||||||
|
# If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle.
|
||||||
|
usesMavenPublishing = true
|
||||||
|
|
||||||
|
# Maven repository to publish the mod to.
|
||||||
|
# mavenPublishUrl = https\://nexus.gtnewhorizons.com/repository/releases/
|
||||||
|
|
||||||
|
# Publishing to Modrinth requires you to set the MODRINTH_TOKEN environment variable to your current Modrinth API token.
|
||||||
|
#
|
||||||
|
# The project's ID on Modrinth. Can be either the slug or the ID.
|
||||||
|
# Leave this empty if you don't want to publish to Modrinth.
|
||||||
|
modrinthProjectId =
|
||||||
|
|
||||||
|
# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth.
|
||||||
|
# Syntax: scope1-type1:name1;scope2-type2:name2;...
|
||||||
|
# Where scope can be one of [required, optional, incompatible, embedded],
|
||||||
|
# type can be one of [project, version],
|
||||||
|
# and the name is the Modrinth project or version slug/id of the other mod.
|
||||||
|
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
|
||||||
|
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
|
||||||
|
modrinthRelations =
|
||||||
|
|
||||||
|
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
|
||||||
|
#
|
||||||
|
# The project's numeric ID on CurseForge. You can find this in the About Project box.
|
||||||
|
# Leave this empty if you don't want to publish on CurseForge.
|
||||||
|
curseForgeProjectId =
|
||||||
|
|
||||||
|
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
|
||||||
|
# Syntax: type1:name1;type2:name2;...
|
||||||
|
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
|
||||||
|
# and the name is the CurseForge project slug of the other mod.
|
||||||
|
# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft
|
||||||
|
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
|
||||||
|
curseForgeRelations =
|
||||||
|
|
||||||
|
# Optional parameter to customize the produced artifacts. Use this to preserve artifact naming when migrating older
|
||||||
|
# projects. New projects should not use this parameter.
|
||||||
|
# customArchiveBaseName =
|
||||||
|
|
||||||
|
# Optional parameter to customize the default working directory used by the runClient* tasks. Relative to the project directory.
|
||||||
|
# runClientWorkingDirectory = run/client
|
||||||
|
|
||||||
|
# Optional parameter to customize the default working directory used by the runServer* tasks. Relative to the project directory.
|
||||||
|
# runServerWorkingDirectory = run/server
|
||||||
|
|
||||||
|
# Optional parameter to have the build automatically fail if an illegal version is used.
|
||||||
|
# This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'.
|
||||||
|
# The check is ONLY performed if the version is a git tag.
|
||||||
|
# Note: the specified string must be escaped, so e.g. 1\\.1\\.\\d+ instead of 1\.1\.\d+
|
||||||
|
# versionPattern =
|
||||||
|
|
||||||
|
# Uncomment to prevent the source code from being published.
|
||||||
|
# noPublishedSources = true
|
||||||
|
|
||||||
|
# Uncomment this to disable Spotless checks.
|
||||||
|
# This should only be uncommented to keep it easier to sync with upstream/other forks.
|
||||||
|
# That is, if there is no other active fork/upstream, NEVER change this.
|
||||||
|
# disableSpotless = true
|
||||||
|
|
||||||
|
# Uncomment this to disable Checkstyle checks (currently wildcard import check).
|
||||||
|
# disableCheckstyle = true
|
||||||
|
|
||||||
|
# Override the IDEA build type. Valid values are: "" (leave blank, do not override), "idea" (force use native IDEA build), "gradle"
|
||||||
|
# (force use delegated build).
|
||||||
|
# This is meant to be set in $HOME/.gradle/gradle.properties.
|
||||||
|
# e.g. add "systemProp.org.gradle.project.ideaOverrideBuildType=idea" will override the build type to be native build.
|
||||||
|
# WARNING: If you do use this option, it will overwrite whatever you have in your existing projects. This might not be what you want!
|
||||||
|
# Usually there is no need to uncomment this here as other developers do not necessarily use the same build type as you.
|
||||||
|
# ideaOverrideBuildType = idea
|
||||||
|
|
||||||
|
# Whether IDEA should run spotless checks when pressing the Build button.
|
||||||
|
# This is meant to be set in $HOME/.gradle/gradle.properties.
|
||||||
|
# ideaCheckSpotlessOnBuild = true
|
||||||
|
|
||||||
|
# Non-GTNH properties
|
||||||
|
org.gradle.configuration-cache = true
|
||||||
|
org.gradle.parallel = true
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#This file is generated by updateDaemonJvm
|
||||||
|
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/97d46b5ff4df0bf61e95652a190a5567/redirect
|
||||||
|
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/9ef54a08e06b0754cee9fc95ed3a3134/redirect
|
||||||
|
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/97d46b5ff4df0bf61e95652a190a5567/redirect
|
||||||
|
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/9ef54a08e06b0754cee9fc95ed3a3134/redirect
|
||||||
|
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1df82b76031285ef2e6a4f59ffe9299d/redirect
|
||||||
|
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/c7d5be6a02945ac2e045048ee54a7d32/redirect
|
||||||
|
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/97d46b5ff4df0bf61e95652a190a5567/redirect
|
||||||
|
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/9ef54a08e06b0754cee9fc95ed3a3134/redirect
|
||||||
|
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/643f404f769811f5f265fd66f7af5d89/redirect
|
||||||
|
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/38256085a73e137cb4937ea9c4807fec/redirect
|
||||||
|
toolchainVersion=25
|
||||||
Vendored
BIN
Binary file not shown.
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
|
||||||
|
networkTimeout=10000
|
||||||
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env sh
|
#!/bin/sh
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright 2015 the original author or authors.
|
# Copyright © 2015 the original authors.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
@@ -15,80 +15,114 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
##
|
#
|
||||||
## Gradle start up script for UN*X
|
# Gradle start up script for POSIX generated by Gradle.
|
||||||
##
|
#
|
||||||
|
# Important for running:
|
||||||
|
#
|
||||||
|
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||||
|
# noncompliant, but you have some other compliant shell such as ksh or
|
||||||
|
# bash, then to run this script, type that shell name before the whole
|
||||||
|
# command line, like:
|
||||||
|
#
|
||||||
|
# ksh Gradle
|
||||||
|
#
|
||||||
|
# Busybox and similar reduced shells will NOT work, because this script
|
||||||
|
# requires all of these POSIX shell features:
|
||||||
|
# * functions;
|
||||||
|
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||||
|
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||||
|
# * compound commands having a testable exit status, especially «case»;
|
||||||
|
# * various built-in commands including «command», «set», and «ulimit».
|
||||||
|
#
|
||||||
|
# Important for patching:
|
||||||
|
#
|
||||||
|
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||||
|
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||||
|
#
|
||||||
|
# The "traditional" practice of packing multiple parameters into a
|
||||||
|
# space-separated string is a well documented source of bugs and security
|
||||||
|
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||||
|
# options in "$@", and eventually passing that to Java.
|
||||||
|
#
|
||||||
|
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||||
|
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||||
|
# see the in-line comments for details.
|
||||||
|
#
|
||||||
|
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||||
|
# Darwin, MinGW, and NonStop.
|
||||||
|
#
|
||||||
|
# (3) This script is generated from the Groovy template
|
||||||
|
# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
|
# within the Gradle project.
|
||||||
|
#
|
||||||
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
# Attempt to set APP_HOME
|
# Attempt to set APP_HOME
|
||||||
|
|
||||||
# Resolve links: $0 may be a link
|
# Resolve links: $0 may be a link
|
||||||
PRG="$0"
|
app_path=$0
|
||||||
# Need this for relative symlinks.
|
|
||||||
while [ -h "$PRG" ] ; do
|
# Need this for daisy-chained symlinks.
|
||||||
ls=`ls -ld "$PRG"`
|
while
|
||||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||||
if expr "$link" : '/.*' > /dev/null; then
|
[ -h "$app_path" ]
|
||||||
PRG="$link"
|
do
|
||||||
else
|
ls=$( ls -ld "$app_path" )
|
||||||
PRG=`dirname "$PRG"`"/$link"
|
link=${ls#*' -> '}
|
||||||
fi
|
case $link in #(
|
||||||
|
/*) app_path=$link ;; #(
|
||||||
|
*) app_path=$APP_HOME$link ;;
|
||||||
|
esac
|
||||||
done
|
done
|
||||||
SAVED="`pwd`"
|
|
||||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
|
||||||
APP_HOME="`pwd -P`"
|
|
||||||
cd "$SAVED" >/dev/null
|
|
||||||
|
|
||||||
APP_NAME="Gradle"
|
# This is normally unused
|
||||||
APP_BASE_NAME=`basename "$0"`
|
# shellcheck disable=SC2034
|
||||||
|
APP_BASE_NAME=${0##*/}
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD="maximum"
|
MAX_FD=maximum
|
||||||
|
|
||||||
warn () {
|
warn () {
|
||||||
echo "$*"
|
echo "$*"
|
||||||
}
|
} >&2
|
||||||
|
|
||||||
die () {
|
die () {
|
||||||
echo
|
echo
|
||||||
echo "$*"
|
echo "$*"
|
||||||
echo
|
echo
|
||||||
exit 1
|
exit 1
|
||||||
}
|
} >&2
|
||||||
|
|
||||||
# OS specific support (must be 'true' or 'false').
|
# OS specific support (must be 'true' or 'false').
|
||||||
cygwin=false
|
cygwin=false
|
||||||
msys=false
|
msys=false
|
||||||
darwin=false
|
darwin=false
|
||||||
nonstop=false
|
nonstop=false
|
||||||
case "`uname`" in
|
case "$( uname )" in #(
|
||||||
CYGWIN* )
|
CYGWIN* ) cygwin=true ;; #(
|
||||||
cygwin=true
|
Darwin* ) darwin=true ;; #(
|
||||||
;;
|
MSYS* | MINGW* ) msys=true ;; #(
|
||||||
Darwin* )
|
NONSTOP* ) nonstop=true ;;
|
||||||
darwin=true
|
|
||||||
;;
|
|
||||||
MINGW* )
|
|
||||||
msys=true
|
|
||||||
;;
|
|
||||||
NONSTOP* )
|
|
||||||
nonstop=true
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
if [ -n "$JAVA_HOME" ] ; then
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
# IBM's JDK on AIX uses strange locations for the executables
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||||
else
|
else
|
||||||
JAVACMD="$JAVA_HOME/bin/java"
|
JAVACMD=$JAVA_HOME/bin/java
|
||||||
fi
|
fi
|
||||||
if [ ! -x "$JAVACMD" ] ; then
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||||
@@ -97,92 +131,118 @@ Please set the JAVA_HOME variable in your environment to match the
|
|||||||
location of your Java installation."
|
location of your Java installation."
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
JAVACMD="java"
|
JAVACMD=java
|
||||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
if ! command -v java >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
Please set the JAVA_HOME variable in your environment to match the
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
location of your Java installation."
|
location of your Java installation."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Increase the maximum file descriptors if we can.
|
# Increase the maximum file descriptors if we can.
|
||||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
MAX_FD_LIMIT=`ulimit -H -n`
|
case $MAX_FD in #(
|
||||||
if [ $? -eq 0 ] ; then
|
max*)
|
||||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
MAX_FD="$MAX_FD_LIMIT"
|
# shellcheck disable=SC2039,SC3045
|
||||||
fi
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
ulimit -n $MAX_FD
|
warn "Could not query maximum file descriptor limit"
|
||||||
if [ $? -ne 0 ] ; then
|
esac
|
||||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
case $MAX_FD in #(
|
||||||
fi
|
'' | soft) :;; #(
|
||||||
else
|
*)
|
||||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
fi
|
# shellcheck disable=SC2039,SC3045
|
||||||
fi
|
ulimit -n "$MAX_FD" ||
|
||||||
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
# For Darwin, add options to specify how the application appears in the dock
|
|
||||||
if $darwin; then
|
|
||||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
|
||||||
fi
|
|
||||||
|
|
||||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
|
||||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
|
||||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
|
||||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
|
||||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
|
||||||
|
|
||||||
# We build the pattern for arguments to be converted via cygpath
|
|
||||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
|
||||||
SEP=""
|
|
||||||
for dir in $ROOTDIRSRAW ; do
|
|
||||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
|
||||||
SEP="|"
|
|
||||||
done
|
|
||||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
|
||||||
# Add a user-defined pattern to the cygpath arguments
|
|
||||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
|
||||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
|
||||||
fi
|
|
||||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
|
||||||
i=0
|
|
||||||
for arg in "$@" ; do
|
|
||||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
|
||||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
|
||||||
|
|
||||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
|
||||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
|
||||||
else
|
|
||||||
eval `echo args$i`="\"$arg\""
|
|
||||||
fi
|
|
||||||
i=$((i+1))
|
|
||||||
done
|
|
||||||
case $i in
|
|
||||||
(0) set -- ;;
|
|
||||||
(1) set -- "$args0" ;;
|
|
||||||
(2) set -- "$args0" "$args1" ;;
|
|
||||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
|
||||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
|
||||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
|
||||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
|
||||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
|
||||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
|
||||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Escape application args
|
# Collect all arguments for the java command, stacking in reverse order:
|
||||||
save () {
|
# * args from the command line
|
||||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
# * the main class name
|
||||||
echo " "
|
# * -classpath
|
||||||
}
|
# * -D...appname settings
|
||||||
APP_ARGS=$(save "$@")
|
# * --module-path (only if needed)
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||||
|
|
||||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
if "$cygwin" || "$msys" ; then
|
||||||
|
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||||
|
|
||||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
|
||||||
cd "$(dirname "$0")"
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
for arg do
|
||||||
|
if
|
||||||
|
case $arg in #(
|
||||||
|
-*) false ;; # don't mess with options #(
|
||||||
|
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||||
|
[ -e "$t" ] ;; #(
|
||||||
|
*) false ;;
|
||||||
|
esac
|
||||||
|
then
|
||||||
|
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||||
|
fi
|
||||||
|
# Roll the args list around exactly as many times as the number of
|
||||||
|
# args, so each arg winds up back in the position where it started, but
|
||||||
|
# possibly modified.
|
||||||
|
#
|
||||||
|
# NB: a `for` loop captures its iteration list before it begins, so
|
||||||
|
# changing the positional parameters here affects neither the number of
|
||||||
|
# iterations, nor the values presented in `arg`.
|
||||||
|
shift # remove old arg
|
||||||
|
set -- "$@" "$arg" # push replacement arg
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
|
# Collect all arguments for the java command:
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
|
# and any embedded shellness will be escaped.
|
||||||
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
||||||
|
set -- \
|
||||||
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
|
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||||
|
"$@"
|
||||||
|
|
||||||
|
# Stop when "xargs" is not available.
|
||||||
|
if ! command -v xargs >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "xargs is not available"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Use "xargs" to parse quoted args.
|
||||||
|
#
|
||||||
|
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||||
|
#
|
||||||
|
# In Bash we could simply go:
|
||||||
|
#
|
||||||
|
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||||
|
# set -- "${ARGS[@]}" "$@"
|
||||||
|
#
|
||||||
|
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||||
|
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||||
|
# character that might be a shell metacharacter, then use eval to reverse
|
||||||
|
# that process (while maintaining the separation between arguments), and wrap
|
||||||
|
# the whole thing up as a single "set" statement.
|
||||||
|
#
|
||||||
|
# This will of course break if any of these variables contains a newline or
|
||||||
|
# an unmatched quote.
|
||||||
|
#
|
||||||
|
|
||||||
|
eval "set -- $(
|
||||||
|
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||||
|
xargs -n1 |
|
||||||
|
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||||
|
tr '\n' ' '
|
||||||
|
)" '"$@"'
|
||||||
|
|
||||||
exec "$JAVACMD" "$@"
|
exec "$JAVACMD" "$@"
|
||||||
Vendored
+27
-34
@@ -13,8 +13,10 @@
|
|||||||
@rem See the License for the specific language governing permissions and
|
@rem See the License for the specific language governing permissions and
|
||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
|
@rem SPDX-License-Identifier: Apache-2.0
|
||||||
|
@rem
|
||||||
|
|
||||||
@if "%DEBUG%" == "" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@rem
|
@rem
|
||||||
@rem Gradle startup script for Windows
|
@rem Gradle startup script for Windows
|
||||||
@@ -25,10 +27,14 @@
|
|||||||
if "%OS%"=="Windows_NT" setlocal
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
set DIRNAME=%~dp0
|
||||||
if "%DIRNAME%" == "" set DIRNAME=.
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
|
@rem This is normally unused
|
||||||
set APP_BASE_NAME=%~n0
|
set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||||
|
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||||
|
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||||
|
|
||||||
@@ -37,13 +43,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome
|
|||||||
|
|
||||||
set JAVA_EXE=java.exe
|
set JAVA_EXE=java.exe
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if "%ERRORLEVEL%" == "0" goto init
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
@@ -51,48 +57,35 @@ goto fail
|
|||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
if exist "%JAVA_EXE%" goto init
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
:init
|
|
||||||
@rem Get command-line arguments, handling Windows variants
|
|
||||||
|
|
||||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
|
||||||
|
|
||||||
:win9xME_args
|
|
||||||
@rem Slurp the command line arguments.
|
|
||||||
set CMD_LINE_ARGS=
|
|
||||||
set _SKIP=2
|
|
||||||
|
|
||||||
:win9xME_args_slurp
|
|
||||||
if "x%~1" == "x" goto execute
|
|
||||||
|
|
||||||
set CMD_LINE_ARGS=%*
|
|
||||||
|
|
||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
@rem Execute Gradle
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||||
|
|
||||||
:end
|
:end
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem End local scope for the variables with windows NT shell
|
||||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||||
|
|
||||||
:fail
|
:fail
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
rem the _cmd.exe /c_ return code!
|
rem the _cmd.exe /c_ return code!
|
||||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
set EXIT_CODE=%ERRORLEVEL%
|
||||||
exit /b 1
|
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||||
|
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||||
|
exit /b %EXIT_CODE%
|
||||||
|
|
||||||
:mainEnd
|
:mainEnd
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|||||||
@@ -1,22 +1,4 @@
|
|||||||
// Add any additional repositories for your dependencies here
|
// Add any additional repositories for your dependencies here
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
|
||||||
name = "GTNH Maven"
|
|
||||||
url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
|
|
||||||
}
|
|
||||||
maven {
|
|
||||||
name = "ic2"
|
|
||||||
url = "https://maven.ic2.player.to/"
|
|
||||||
metadataSources {
|
|
||||||
mavenPom()
|
|
||||||
artifact()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
maven {
|
|
||||||
url "https://cursemaven.com"
|
|
||||||
}
|
|
||||||
maven {
|
|
||||||
url = "https://jitpack.io"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
pluginManagement {
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
// RetroFuturaGradle
|
||||||
|
name "GTNH Maven"
|
||||||
|
url "https://nexus.gtnewhorizons.com/repository/public/"
|
||||||
|
mavenContent {
|
||||||
|
includeGroup("com.gtnewhorizons")
|
||||||
|
includeGroupByRegex("com\\.gtnewhorizons\\..+")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
gradlePluginPortal()
|
||||||
|
mavenCentral()
|
||||||
|
mavenLocal()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.29'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1,14 +1,28 @@
|
|||||||
package com.gtnh.findit;
|
package com.gtnh.findit;
|
||||||
|
|
||||||
import codechicken.nei.guihook.GuiContainerManager;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.gtnewhorizon.gtnhlib.config.ConfigException;
|
||||||
|
import com.gtnewhorizon.gtnhlib.config.ConfigurationManager;
|
||||||
|
import com.gtnh.findit.IStackFilter.IStackFilterProvider;
|
||||||
|
import com.gtnh.findit.handler.AdventureBackpackProvider;
|
||||||
|
import com.gtnh.findit.handler.BackpackProvider;
|
||||||
|
import com.gtnh.findit.handler.DraconicEvolutionProvider;
|
||||||
|
import com.gtnh.findit.handler.ForestryStackFilterProvider;
|
||||||
|
import com.gtnh.findit.handler.GregTechCoverChestProvider;
|
||||||
|
import com.gtnh.findit.handler.GregTechCoverProvider;
|
||||||
|
import com.gtnh.findit.handler.MinecraftProvider;
|
||||||
|
import com.gtnh.findit.handler.ProjectRedExplorationProvider;
|
||||||
|
import com.gtnh.findit.handler.ThaumcraftProvider;
|
||||||
import com.gtnh.findit.service.blockfinder.BlockFindService;
|
import com.gtnh.findit.service.blockfinder.BlockFindService;
|
||||||
import com.gtnh.findit.service.blockfinder.ClientBlockFindService;
|
import com.gtnh.findit.service.blockfinder.ClientBlockFindService;
|
||||||
import com.gtnh.findit.service.cooldown.SearchCooldownService;
|
import com.gtnh.findit.service.cooldown.SearchCooldownService;
|
||||||
import com.gtnh.findit.service.itemfinder.ClientItemFindService;
|
import com.gtnh.findit.service.itemfinder.ClientItemFindService;
|
||||||
import com.gtnh.findit.service.itemfinder.ItemFindService;
|
import com.gtnh.findit.service.itemfinder.ItemFindService;
|
||||||
|
|
||||||
import cpw.mods.fml.common.Loader;
|
import cpw.mods.fml.common.Loader;
|
||||||
import cpw.mods.fml.common.Mod;
|
import cpw.mods.fml.common.Mod;
|
||||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
|
||||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
|
||||||
@@ -16,43 +30,79 @@ import cpw.mods.fml.relauncher.Side;
|
|||||||
modid = FindIt.MOD_ID,
|
modid = FindIt.MOD_ID,
|
||||||
name = FindIt.MOD_NAME,
|
name = FindIt.MOD_NAME,
|
||||||
version = FindIt.VERSION,
|
version = FindIt.VERSION,
|
||||||
dependencies = "required-after:NotEnoughItems;required-after:gregtech",
|
dependencies = "required-after:NotEnoughItems;after:gregtech",
|
||||||
acceptableRemoteVersions = "*"
|
acceptableRemoteVersions = "*",
|
||||||
)
|
acceptedMinecraftVersions = "[1.7.10]")
|
||||||
public class FindIt {
|
public class FindIt {
|
||||||
|
|
||||||
// Mod info
|
// Mod info
|
||||||
public static final String MOD_ID = "GRADLETOKEN_MODID";
|
public static final String MOD_ID = "findit";
|
||||||
public static final String MOD_NAME = "GRADLETOKEN_MODNAME";
|
public static final String MOD_NAME = "FindIt";
|
||||||
public static final String VERSION = "GRADLETOKEN_VERSION";
|
public static final String VERSION = Tags.VERSION;
|
||||||
|
|
||||||
@Mod.Instance(MOD_ID)
|
@Mod.Instance(MOD_ID)
|
||||||
public static FindIt INSTANCE;
|
public static FindIt INSTANCE;
|
||||||
|
|
||||||
private boolean extraUtilitiesLoaded;
|
private boolean isEnderIOLoaded;
|
||||||
|
private boolean isExtraUtilitiesLoaded;
|
||||||
|
private boolean isGregTechLoaded;
|
||||||
|
|
||||||
private SearchCooldownService cooldownService;
|
private SearchCooldownService cooldownService;
|
||||||
private BlockFindService blockFindService;
|
private BlockFindService blockFindService;
|
||||||
private ItemFindService itemFindService;
|
private ItemFindService itemFindService;
|
||||||
|
|
||||||
|
public final List<IStackFilterProvider> pluginsList = new ArrayList<>();
|
||||||
|
|
||||||
@Mod.EventHandler
|
@Mod.EventHandler
|
||||||
public void preInit(FMLPreInitializationEvent event) {
|
public void preInit(FMLPreInitializationEvent event) {
|
||||||
extraUtilitiesLoaded = Loader.isModLoaded("ExtraUtilities");
|
this.isExtraUtilitiesLoaded = Loader.isModLoaded("ExtraUtilities");
|
||||||
FindItConfig.setup(event.getSuggestedConfigurationFile());
|
this.isGregTechLoaded = Loader.isModLoaded("gregtech") && !Loader.isModLoaded("gregapi");
|
||||||
boolean isClient = event.getSide() == Side.CLIENT;
|
this.isEnderIOLoaded = Loader.isModLoaded("EnderIO");
|
||||||
|
this.cooldownService = new SearchCooldownService();
|
||||||
cooldownService = new SearchCooldownService();
|
try {
|
||||||
blockFindService = isClient ? new ClientBlockFindService() : new BlockFindService();
|
ConfigurationManager.registerConfig(FindItConfig.class);
|
||||||
itemFindService = isClient ? new ClientItemFindService() : new ItemFindService();
|
} catch (ConfigException e) {
|
||||||
}
|
throw new RuntimeException(e);
|
||||||
|
|
||||||
@Mod.EventHandler
|
|
||||||
public void postInit(FMLPostInitializationEvent event) {
|
|
||||||
if (event.getSide() == Side.CLIENT && FindIt.isExtraUtilitiesLoaded()) {
|
|
||||||
GuiContainerManager.inputHandlers.removeIf((inputHandler) ->
|
|
||||||
inputHandler.getClass().getName().equals("com.rwtema.extrautils.nei.ping.NEIPing")
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (event.getSide() == Side.CLIENT) {
|
||||||
|
this.blockFindService = new ClientBlockFindService();
|
||||||
|
this.itemFindService = new ClientItemFindService();
|
||||||
|
} else {
|
||||||
|
this.blockFindService = new BlockFindService();
|
||||||
|
this.itemFindService = new ItemFindService();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Loader.isModLoaded("Forestry")) {
|
||||||
|
this.pluginsList.add(new ForestryStackFilterProvider());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Loader.isModLoaded("adventurebackpack")) {
|
||||||
|
this.pluginsList.add(new AdventureBackpackProvider());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Loader.isModLoaded("ProjRed|Exploration")) {
|
||||||
|
this.pluginsList.add(new ProjectRedExplorationProvider());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Loader.isModLoaded("DraconicEvolution")) {
|
||||||
|
this.pluginsList.add(new DraconicEvolutionProvider());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Loader.isModLoaded("Backpack")) {
|
||||||
|
this.pluginsList.add(new BackpackProvider());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Loader.isModLoaded("Thaumcraft")) {
|
||||||
|
this.pluginsList.add(new ThaumcraftProvider());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.isGregTechLoaded) {
|
||||||
|
this.pluginsList.add(new GregTechCoverProvider());
|
||||||
|
this.pluginsList.add(new GregTechCoverChestProvider());
|
||||||
|
}
|
||||||
|
|
||||||
|
this.pluginsList.add(new MinecraftProvider());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SearchCooldownService getCooldownService() {
|
public static SearchCooldownService getCooldownService() {
|
||||||
@@ -68,6 +118,15 @@ public class FindIt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isExtraUtilitiesLoaded() {
|
public static boolean isExtraUtilitiesLoaded() {
|
||||||
return INSTANCE.extraUtilitiesLoaded;
|
return INSTANCE.isExtraUtilitiesLoaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isGregTechLoaded() {
|
||||||
|
return INSTANCE.isGregTechLoaded;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isEnderIOLoaded() {
|
||||||
|
return INSTANCE.isEnderIOLoaded;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,43 +1,73 @@
|
|||||||
package com.gtnh.findit;
|
package com.gtnh.findit;
|
||||||
|
|
||||||
import net.minecraftforge.common.config.Configuration;
|
import com.gtnewhorizon.gtnhlib.config.Config;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
|
@Config(modid = "findit")
|
||||||
public class FindItConfig {
|
public class FindItConfig {
|
||||||
|
|
||||||
public static int SEARCH_RADIUS = 16;
|
@Config.Comment("Radius to search within")
|
||||||
public static int SEARCH_COOLDOWN = 10;
|
@Config.DefaultInt(16)
|
||||||
public static int MAX_RESPONSE_SIZE = 20;
|
@Config.RangeInt(min = 1)
|
||||||
|
@Config.Name("SearchRadius")
|
||||||
|
public static int SEARCH_RADIUS;
|
||||||
|
|
||||||
public static void setup(final File file) {
|
@Config.Comment("Search cooldown in ticks")
|
||||||
final Configuration config = new Configuration(file);
|
@Config.DefaultInt(10)
|
||||||
try {
|
@Config.RangeInt(min = 0)
|
||||||
config.load();
|
@Config.Name("SearchCooldown")
|
||||||
|
public static int SEARCH_COOLDOWN;
|
||||||
|
|
||||||
SEARCH_RADIUS = config.get(
|
@Config.Comment("Maximum number of positions that can be displayed by item/block search")
|
||||||
Configuration.CATEGORY_GENERAL,
|
@Config.DefaultInt(20)
|
||||||
"SearchRadius",
|
@Config.RangeInt(min = 0)
|
||||||
"16",
|
@Config.Name("MaxResponseSize")
|
||||||
"Radius to search within"
|
public static int MAX_RESPONSE_SIZE;
|
||||||
).getInt();
|
|
||||||
|
|
||||||
SEARCH_COOLDOWN = config.get(
|
@Config.Comment("Rotate the player's view to face found items/blocks after searching")
|
||||||
Configuration.CATEGORY_GENERAL,
|
@Config.DefaultBoolean(false)
|
||||||
"SearchCooldown",
|
@Config.Name("EnableRotateView")
|
||||||
"10",
|
public static boolean ENABLE_ROTATE_VIEW;
|
||||||
"Search cooldown in ticks"
|
|
||||||
).getInt();
|
|
||||||
|
|
||||||
MAX_RESPONSE_SIZE = config.get(
|
@Config.Comment("Use particles for the block highlighter instead of outlining found blocks")
|
||||||
Configuration.CATEGORY_GENERAL,
|
@Config.DefaultBoolean(false)
|
||||||
"MaxResponseSize",
|
@Config.Name("UseParticleHighlighter")
|
||||||
"20",
|
public static boolean USE_PARTICLE_HIGHLIGHTER;
|
||||||
"Maximum number of positions that can be displayed by item/block search"
|
|
||||||
).getInt();
|
@Config.Comment("Search items dropped on the ground")
|
||||||
} catch (Exception ignore) {
|
@Config.DefaultBoolean(true)
|
||||||
} finally {
|
@Config.Name("SearchItemsOnGround")
|
||||||
if (config.hasChanged()) config.save();
|
public static boolean SEARCH_ITEMS_ON_GROUND;
|
||||||
}
|
|
||||||
}
|
@Config.Comment("Search items and fluids in GT pipes")
|
||||||
|
@Config.DefaultBoolean(false)
|
||||||
|
@Config.Name("SearchInGregTechPipes")
|
||||||
|
public static boolean SEARCH_IN_GT_PIPES;
|
||||||
|
|
||||||
|
@Config.Comment("Search items and fluids in EnderIO conduits")
|
||||||
|
@Config.DefaultBoolean(false)
|
||||||
|
@Config.Name("SearchInEnderIOConduits")
|
||||||
|
public static boolean SEARCH_IN_ENDERIO_CONDUITS;
|
||||||
|
|
||||||
|
@Config.Comment("Item highlighting duration in seconds")
|
||||||
|
@Config.DefaultInt(10)
|
||||||
|
@Config.RangeInt(min = 1)
|
||||||
|
@Config.Name("ItemHighlightingDuration")
|
||||||
|
public static int ITEM_HIGHLIGHTING_DURATION;
|
||||||
|
|
||||||
|
@Config.Comment("Block highlighting duration in seconds")
|
||||||
|
@Config.DefaultInt(8)
|
||||||
|
@Config.RangeInt(min = 1)
|
||||||
|
@Config.Name("BlockHighlightingDuration")
|
||||||
|
public static int BLOCK_HIGHLIGHTING_DURATION;
|
||||||
|
|
||||||
|
@Config.Comment("Item highlighting color as an ARGB hexadecimal color code.\nDo not prefix with \"0x\"")
|
||||||
|
@Config.DefaultString("FFFF8726")
|
||||||
|
@Config.Name("ItemHighlightingColor")
|
||||||
|
public static String ITEM_HIGHLIGHTING_COLOR;
|
||||||
|
|
||||||
|
@Config.Comment("If true, the item stack size is ignored. If false, items are only highlighted if their stack size is greater than zero.\n"
|
||||||
|
+ "This is useful when working with barrels or storage drawers.")
|
||||||
|
@Config.DefaultBoolean(true)
|
||||||
|
@Config.Name("ItemHighlightingEmptyItemStacks")
|
||||||
|
public static boolean ITEM_HIGHLIGHTING_EMPTY_ITEMSTACKS;
|
||||||
}
|
}
|
||||||
@@ -11,7 +11,8 @@ public class FindItNetwork {
|
|||||||
private static int lastMessageId = -1;
|
private static int lastMessageId = -1;
|
||||||
public static final SimpleNetworkWrapper CHANNEL = NetworkRegistry.INSTANCE.newSimpleChannel(FindIt.MOD_ID);
|
public static final SimpleNetworkWrapper CHANNEL = NetworkRegistry.INSTANCE.newSimpleChannel(FindIt.MOD_ID);
|
||||||
|
|
||||||
public static <REQ extends IMessage, REPLY extends IMessage> void registerMessage(Class<? extends IMessageHandler<REQ, REPLY>> messageHandler, Class<REQ> requestMessageType, Side side) {
|
public static <REQ extends IMessage, REPLY extends IMessage> void registerMessage(
|
||||||
|
Class<? extends IMessageHandler<REQ, REPLY>> messageHandler, Class<REQ> requestMessageType, Side side) {
|
||||||
CHANNEL.registerMessage(messageHandler, requestMessageType, ++lastMessageId, side);
|
CHANNEL.registerMessage(messageHandler, requestMessageType, ++lastMessageId, side);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,129 @@
|
|||||||
|
package com.gtnh.findit;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.inventory.IInventory;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
|
|
||||||
|
import com.gtnh.findit.service.itemfinder.FindItemRequest;
|
||||||
|
|
||||||
|
@FunctionalInterface
|
||||||
|
public interface IStackFilter {
|
||||||
|
|
||||||
|
boolean matches(FindItemRequest request);
|
||||||
|
|
||||||
|
public static interface IStackFilterProvider {
|
||||||
|
|
||||||
|
IStackFilter getFilter(EntityPlayer player, TileEntity tileEntity);
|
||||||
|
|
||||||
|
IStackFilter getFilter(EntityPlayer player, ItemStack stack);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class InventoryStackFilter implements IStackFilter {
|
||||||
|
|
||||||
|
private final IInventory inventory;
|
||||||
|
private final EntityPlayer player;
|
||||||
|
|
||||||
|
public InventoryStackFilter(EntityPlayer player, IInventory inventory) {
|
||||||
|
this.inventory = inventory;
|
||||||
|
this.player = player;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean matches(FindItemRequest request) {
|
||||||
|
|
||||||
|
for (int slot = 0; slot < this.inventory.getSizeInventory(); slot++) {
|
||||||
|
ItemStack slotItem = this.inventory.getStackInSlot(slot);
|
||||||
|
if (slotItem != null && request.isStackSatisfies(this.player, slotItem)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class FluidStackFilter implements IStackFilter {
|
||||||
|
|
||||||
|
private final List<FluidStack> fluids;
|
||||||
|
|
||||||
|
public FluidStackFilter(List<FluidStack> fluids) {
|
||||||
|
this.fluids = fluids;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FluidStackFilter() {
|
||||||
|
this(new ArrayList<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
public FluidStackFilter(FluidStack fluid) {
|
||||||
|
this();
|
||||||
|
add(fluid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void add(FluidStack fluid) {
|
||||||
|
if (fluid != null) {
|
||||||
|
this.fluids.add(fluid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isEmpty() {
|
||||||
|
return this.fluids.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean matches(FindItemRequest request) {
|
||||||
|
|
||||||
|
for (FluidStack fluid : this.fluids) {
|
||||||
|
if (fluid != null && request.isFluidSatisfies(fluid)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class AnyMultiItemFilter implements IStackFilter {
|
||||||
|
|
||||||
|
private final List<IStackFilter> filters;
|
||||||
|
|
||||||
|
public AnyMultiItemFilter(List<IStackFilter> filters) {
|
||||||
|
this.filters = filters;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AnyMultiItemFilter() {
|
||||||
|
this(new ArrayList<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void add(IStackFilter filter) {
|
||||||
|
if (filter != null) {
|
||||||
|
this.filters.add(filter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isEmpty() {
|
||||||
|
return this.filters.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean matches(FindItemRequest request) {
|
||||||
|
|
||||||
|
for (IStackFilter filter : this.filters) {
|
||||||
|
if (filter != null && filter.matches(request)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
package com.gtnh.findit.fx;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.BlockChest;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.multiplayer.WorldClient;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.tileentity.TileEntityChest;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
|
import net.minecraft.world.ChunkPosition;
|
||||||
|
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import com.gtnh.findit.util.ClientFinderHelperUtils;
|
||||||
|
|
||||||
|
public class BlockHighlighter {
|
||||||
|
|
||||||
|
private List<ChunkPosition> positions = new ArrayList<>();
|
||||||
|
private long expireHighlight;
|
||||||
|
|
||||||
|
public void highlightBlocks(List<ChunkPosition> positions, long expireHighlight) {
|
||||||
|
this.positions = positions;
|
||||||
|
this.expireHighlight = expireHighlight;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void renderHighlightedBlock(RenderWorldLastEvent event) {
|
||||||
|
if (this.positions.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Minecraft mc = Minecraft.getMinecraft();
|
||||||
|
long time = System.currentTimeMillis();
|
||||||
|
|
||||||
|
if (((time / 500) & 1) == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (time > expireHighlight) {
|
||||||
|
positions.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
EntityLivingBase p = mc.renderViewEntity != null ? mc.renderViewEntity : mc.thePlayer;
|
||||||
|
double doubleX = p.lastTickPosX + (p.posX - p.lastTickPosX) * event.partialTicks;
|
||||||
|
double doubleY = p.lastTickPosY + (p.posY - p.lastTickPosY) * event.partialTicks;
|
||||||
|
double doubleZ = p.lastTickPosZ + (p.posZ - p.lastTickPosZ) * event.partialTicks;
|
||||||
|
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
|
||||||
|
GL11.glLineWidth(3);
|
||||||
|
GL11.glTranslated(-doubleX, -doubleY, -doubleZ);
|
||||||
|
|
||||||
|
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||||
|
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||||
|
|
||||||
|
GL11.glColor4f(1.0f, 0.0f, 0.0f, 1.0f);
|
||||||
|
|
||||||
|
for (ChunkPosition pos : this.positions) {
|
||||||
|
drawBlockHighlightBox(mc.theWorld, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
GL11.glPopAttrib();
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void drawBlockHighlightBox(WorldClient world, ChunkPosition pos) {
|
||||||
|
Block block = world.getBlock(pos.chunkPosX, pos.chunkPosY, pos.chunkPosZ);
|
||||||
|
|
||||||
|
AxisAlignedBB box;
|
||||||
|
if (block instanceof BlockChest) {
|
||||||
|
box = getChestHighlightBox(world, (BlockChest) block, pos);
|
||||||
|
} else {
|
||||||
|
box = getBlockHighlightBox(world, block, pos.chunkPosX, pos.chunkPosY, pos.chunkPosZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
FxHelper.renderBoxOutline(box);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static AxisAlignedBB getChestHighlightBox(WorldClient world, BlockChest block, ChunkPosition pos) {
|
||||||
|
AxisAlignedBB chestBox = getBlockHighlightBox(world, block, pos.chunkPosX, pos.chunkPosY, pos.chunkPosZ);
|
||||||
|
|
||||||
|
TileEntity tileEntity = world.getTileEntity(pos.chunkPosX, pos.chunkPosY, pos.chunkPosZ);
|
||||||
|
if (!(tileEntity instanceof TileEntityChest)) {
|
||||||
|
return chestBox;
|
||||||
|
}
|
||||||
|
TileEntityChest chest = (TileEntityChest) tileEntity;
|
||||||
|
|
||||||
|
TileEntityChest nearChest = null;
|
||||||
|
if (chest.adjacentChestXNeg != null) {
|
||||||
|
nearChest = chest.adjacentChestXNeg;
|
||||||
|
} else if (chest.adjacentChestXPos != null) {
|
||||||
|
nearChest = chest.adjacentChestXPos;
|
||||||
|
} else if (chest.adjacentChestZNeg != null) {
|
||||||
|
nearChest = chest.adjacentChestZNeg;
|
||||||
|
} else if (chest.adjacentChestZPos != null) {
|
||||||
|
nearChest = chest.adjacentChestZPos;
|
||||||
|
}
|
||||||
|
if (nearChest == null) {
|
||||||
|
return chestBox;
|
||||||
|
}
|
||||||
|
|
||||||
|
AxisAlignedBB nearChestBox = getBlockHighlightBox(
|
||||||
|
world,
|
||||||
|
nearChest.getBlockType(),
|
||||||
|
nearChest.xCoord,
|
||||||
|
nearChest.yCoord,
|
||||||
|
nearChest.zCoord);
|
||||||
|
return ClientFinderHelperUtils.mergeAABB(chestBox, nearChestBox);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static AxisAlignedBB getBlockHighlightBox(WorldClient world, Block block, int x, int y, int z) {
|
||||||
|
block.setBlockBoundsBasedOnState(world, x, y, z);
|
||||||
|
AxisAlignedBB box = block.getSelectedBoundingBoxFromPool(world, x, y, z);
|
||||||
|
if (box.maxX - box.minX < 0.25f || box.maxY - box.minY < 0.25f || box.maxZ - box.minZ < 0.25f) {
|
||||||
|
return AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1);
|
||||||
|
}
|
||||||
|
return box;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
package com.gtnh.findit.fx;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.entity.RenderItem;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.item.EntityItem;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
public class EntityHighlighter {
|
||||||
|
|
||||||
|
private List<Integer> entityIds = new ArrayList<>();
|
||||||
|
private long expireHighlight;
|
||||||
|
|
||||||
|
public void highlightEntities(List<Integer> entityIds, long expireHighlight) {
|
||||||
|
this.entityIds = entityIds;
|
||||||
|
this.expireHighlight = expireHighlight;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void renderHighlightedEntities(RenderWorldLastEvent event) {
|
||||||
|
if (this.entityIds.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Minecraft mc = Minecraft.getMinecraft();
|
||||||
|
RenderItem renderItem = RenderItem.getInstance();
|
||||||
|
long time = System.currentTimeMillis();
|
||||||
|
|
||||||
|
if (((time / 500) & 1) == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (time > expireHighlight) {
|
||||||
|
entityIds.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
EntityLivingBase p = mc.renderViewEntity != null ? mc.renderViewEntity : mc.thePlayer;
|
||||||
|
double doubleX = p.lastTickPosX + (p.posX - p.lastTickPosX) * event.partialTicks;
|
||||||
|
double doubleY = p.lastTickPosY + (p.posY - p.lastTickPosY) * event.partialTicks;
|
||||||
|
double doubleZ = p.lastTickPosZ + (p.posZ - p.lastTickPosZ) * event.partialTicks;
|
||||||
|
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
|
||||||
|
GL11.glLineWidth(3);
|
||||||
|
GL11.glTranslated(-doubleX, -doubleY, -doubleZ);
|
||||||
|
|
||||||
|
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||||
|
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||||
|
|
||||||
|
GL11.glColor4f(0.75f, 0.0f, 1.0f, 1.0f);
|
||||||
|
|
||||||
|
for (int entityId : this.entityIds) {
|
||||||
|
Entity entity = mc.theWorld.getEntityByID(entityId);
|
||||||
|
if (entity != null) {
|
||||||
|
|
||||||
|
float scale = 1f;
|
||||||
|
|
||||||
|
if (entity instanceof EntityItem) {
|
||||||
|
EntityItem item = (EntityItem) entity;
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
|
||||||
|
double itemX = item.lastTickPosX + (item.posX - item.lastTickPosX) * event.partialTicks;
|
||||||
|
double itemY = item.lastTickPosY + (item.posY - item.lastTickPosY) * event.partialTicks;
|
||||||
|
double itemZ = item.lastTickPosZ + (item.posZ - item.lastTickPosZ) * event.partialTicks;
|
||||||
|
float age = item.age + event.partialTicks;
|
||||||
|
|
||||||
|
float elevation = renderItem.shouldBob()
|
||||||
|
? MathHelper.sin(age / 10.0F + item.hoverStart) * 0.1F + 0.1F
|
||||||
|
: 0F;
|
||||||
|
float angle = (age / 20.0F + item.hoverStart) * (180F / (float) Math.PI);
|
||||||
|
|
||||||
|
GL11.glTranslated(itemX, itemY, itemZ);
|
||||||
|
GL11.glRotated(angle, 0, 1, 0);
|
||||||
|
GL11.glTranslated(-itemX, -itemY + elevation, -itemZ);
|
||||||
|
scale = 1.2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
FxHelper.renderEntityOutline(entity, scale, event.partialTicks);
|
||||||
|
|
||||||
|
if (entity instanceof EntityItem) {
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GL11.glPopAttrib();
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
package com.gtnh.findit.fx;
|
||||||
|
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
|
import net.minecraft.world.ChunkPosition;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
public class FxHelper {
|
||||||
|
|
||||||
|
public static void renderBlockOutline(ChunkPosition pos) {
|
||||||
|
renderOutline(
|
||||||
|
pos.chunkPosX,
|
||||||
|
pos.chunkPosY,
|
||||||
|
pos.chunkPosZ,
|
||||||
|
pos.chunkPosX + 1,
|
||||||
|
pos.chunkPosY + 1,
|
||||||
|
pos.chunkPosZ + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void renderBoxOutline(AxisAlignedBB box) {
|
||||||
|
renderOutline(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void renderEntityOutline(Entity entity, float scale, float partialTicks) {
|
||||||
|
double x = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double) partialTicks;
|
||||||
|
double y = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double) partialTicks;
|
||||||
|
double z = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double) partialTicks;
|
||||||
|
float w = entity.width / 2.0F;
|
||||||
|
float h = entity.height;
|
||||||
|
|
||||||
|
if (scale != 1f) {
|
||||||
|
w *= scale;
|
||||||
|
h *= scale;
|
||||||
|
y -= entity.height * (scale - 1f) / 2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
renderOutline(x - (double) w, y, z - (double) w, x + (double) w, y + (double) h, z + (double) w);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void renderOutline(double x0, double y0, double z0, double x1, double y1, double z1) {
|
||||||
|
GL11.glBegin(GL11.GL_LINE_STRIP);
|
||||||
|
|
||||||
|
GL11.glVertex3d(x0, y0, z0);
|
||||||
|
GL11.glVertex3d(x0, y1, z0);
|
||||||
|
GL11.glVertex3d(x0, y1, z1);
|
||||||
|
GL11.glVertex3d(x0, y0, z1);
|
||||||
|
GL11.glVertex3d(x0, y0, z0);
|
||||||
|
|
||||||
|
GL11.glVertex3d(x1, y0, z0);
|
||||||
|
GL11.glVertex3d(x1, y1, z0);
|
||||||
|
GL11.glVertex3d(x1, y1, z1);
|
||||||
|
GL11.glVertex3d(x1, y0, z1);
|
||||||
|
GL11.glVertex3d(x1, y0, z0);
|
||||||
|
|
||||||
|
GL11.glVertex3d(x0, y0, z0);
|
||||||
|
GL11.glVertex3d(x1, y0, z0);
|
||||||
|
GL11.glVertex3d(x1, y0, z1);
|
||||||
|
GL11.glVertex3d(x0, y0, z1);
|
||||||
|
GL11.glVertex3d(x0, y1, z1);
|
||||||
|
GL11.glVertex3d(x1, y1, z1);
|
||||||
|
GL11.glVertex3d(x1, y1, z0);
|
||||||
|
GL11.glVertex3d(x1, y0, z0);
|
||||||
|
GL11.glVertex3d(x0, y0, z0);
|
||||||
|
GL11.glVertex3d(x1, y0, z0);
|
||||||
|
GL11.glVertex3d(x1, y1, z0);
|
||||||
|
GL11.glVertex3d(x0, y1, z0);
|
||||||
|
GL11.glVertex3d(x0, y1, z1);
|
||||||
|
GL11.glVertex3d(x1, y1, z1);
|
||||||
|
GL11.glVertex3d(x1, y0, z1);
|
||||||
|
GL11.glVertex3d(x0, y0, z1);
|
||||||
|
|
||||||
|
GL11.glEnd();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,13 +1,14 @@
|
|||||||
package com.gtnh.findit.fx;
|
package com.gtnh.findit.fx;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.particle.EntityReddustFX;
|
import net.minecraft.client.particle.EntityReddustFX;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.world.ChunkPosition;
|
import net.minecraft.world.ChunkPosition;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import org.lwjgl.opengl.GL11;
|
|
||||||
|
|
||||||
import java.util.List;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
public class ParticlePosition extends EntityReddustFX {
|
public class ParticlePosition extends EntityReddustFX {
|
||||||
|
|
||||||
@@ -20,8 +21,7 @@ public class ParticlePosition extends EntityReddustFX {
|
|||||||
world,
|
world,
|
||||||
pos.chunkPosX + (0.5 + (world.rand.nextDouble() - 0.5) * world.rand.nextDouble()),
|
pos.chunkPosX + (0.5 + (world.rand.nextDouble() - 0.5) * world.rand.nextDouble()),
|
||||||
pos.chunkPosY + (0.5 + (world.rand.nextDouble() - 0.5) * world.rand.nextDouble()),
|
pos.chunkPosY + (0.5 + (world.rand.nextDouble() - 0.5) * world.rand.nextDouble()),
|
||||||
pos.chunkPosZ + (0.5 + (world.rand.nextDouble() - 0.5) * world.rand.nextDouble())
|
pos.chunkPosZ + (0.5 + (world.rand.nextDouble() - 0.5) * world.rand.nextDouble()));
|
||||||
);
|
|
||||||
version = validVersion;
|
version = validVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,16 +45,18 @@ public class ParticlePosition extends EntityReddustFX {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderParticle(final Tessellator tessellator, float partialTickTime, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) {
|
public void renderParticle(final Tessellator tessellator, float partialTickTime, float rotationX, float rotationZ,
|
||||||
|
float rotationYZ, float rotationXY, float rotationXZ) {
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
|
|
||||||
|
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
|
||||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||||
|
|
||||||
tessellator.startDrawingQuads();
|
tessellator.startDrawingQuads();
|
||||||
super.renderParticle(tessellator, partialTickTime, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ);
|
super.renderParticle(tessellator, partialTickTime, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ);
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
|
|
||||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
GL11.glPopAttrib();
|
||||||
tessellator.startDrawingQuads();
|
tessellator.startDrawingQuads();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,63 +1,88 @@
|
|||||||
package com.gtnh.findit.fx;
|
package com.gtnh.findit.fx;
|
||||||
|
|
||||||
import com.gtnh.findit.FindIt;
|
import java.util.HashSet;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||||
import net.minecraft.client.renderer.OpenGlHelper;
|
import net.minecraft.client.renderer.OpenGlHelper;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.inventory.Slot;
|
import net.minecraft.inventory.Slot;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import java.util.List;
|
import com.gtnh.findit.FindIt;
|
||||||
|
|
||||||
public class SlotHighlighter {
|
import codechicken.nei.guihook.IContainerDrawHandler;
|
||||||
|
|
||||||
private static final ResourceLocation highlightTexture = new ResourceLocation(FindIt.MOD_ID, "textures/gui/slot_highlight.png");
|
public class SlotHighlighter implements IContainerDrawHandler {
|
||||||
|
|
||||||
public static void highlightSlots(GuiContainer gui, List<Integer> slots, int color) {
|
private static final ResourceLocation highlightTexture = new ResourceLocation(
|
||||||
if (slots.isEmpty()) {
|
FindIt.MOD_ID,
|
||||||
return;
|
"textures/gui/slot_highlight.png");
|
||||||
}
|
|
||||||
|
|
||||||
float red = (float) (color >> 16 & 255) / 255.0F;
|
private GuiContainer gui = null;
|
||||||
float green = (float) (color >> 8 & 255) / 255.0F;
|
private HashSet<Slot> slots = new HashSet<>();
|
||||||
float blue = (float) (color & 255) / 255.0F;
|
private float red = 0;
|
||||||
float alpha = (float) (color >> 24 & 255) / 255.0F;
|
private float green = 0;
|
||||||
|
private float blue = 0;
|
||||||
|
private float alpha = 0;
|
||||||
|
|
||||||
GL11.glPushMatrix();
|
public void highlightSlots(GuiContainer gui, HashSet<Slot> slots, int color) {
|
||||||
GL11.glTranslated(gui.guiLeft, gui.guiTop, 0);
|
|
||||||
|
|
||||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
this.gui = gui;
|
||||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
this.slots = slots;
|
||||||
GL11.glEnable(GL11.GL_BLEND);
|
|
||||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
|
||||||
|
|
||||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
this.red = (float) (color >> 16 & 255) / 255.0F;
|
||||||
Minecraft.getMinecraft().getTextureManager().bindTexture(highlightTexture);
|
this.green = (float) (color >> 8 & 255) / 255.0F;
|
||||||
|
this.blue = (float) (color & 255) / 255.0F;
|
||||||
Tessellator tessellator = Tessellator.instance;
|
this.alpha = (float) (color >> 24 & 255) / 255.0F;
|
||||||
tessellator.startDrawingQuads();
|
|
||||||
tessellator.setColorRGBA_F(red, green, blue, alpha);
|
|
||||||
|
|
||||||
for (int slotId : slots) {
|
|
||||||
Slot slot = gui.inventorySlots.getSlot(slotId);
|
|
||||||
highlightSlot(tessellator, slot.xDisplayPosition - 1, slot.yDisplayPosition - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
tessellator.draw();
|
|
||||||
|
|
||||||
GL11.glShadeModel(GL11.GL_FLAT);
|
|
||||||
GL11.glDisable(GL11.GL_BLEND);
|
|
||||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void highlightSlot(Tessellator tessellator, int x, int y) {
|
@Override
|
||||||
|
public void onPreDraw(GuiContainer gui) {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderObjects(GuiContainer gui, int mousex, int mousey) {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void postRenderObjects(GuiContainer gui, int mousex, int mousey) {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderSlotOverlay(GuiContainer gui, Slot slot) {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderSlotUnderlay(GuiContainer gui, Slot slot) {
|
||||||
|
if (this.gui == gui && this.slots.contains(slot)) {
|
||||||
|
GL11.glPushAttrib(
|
||||||
|
GL11.GL_ENABLE_BIT | GL11.GL_COLOR_BUFFER_BIT
|
||||||
|
| GL11.GL_CURRENT_BIT
|
||||||
|
| GL11.GL_LIGHTING_BIT
|
||||||
|
| GL11.GL_TEXTURE_BIT);
|
||||||
|
|
||||||
|
GL11.glDisable(GL11.GL_LIGHTING);
|
||||||
|
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||||
|
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||||
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
|
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||||
|
|
||||||
|
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||||
|
Minecraft.getMinecraft().getTextureManager().bindTexture(highlightTexture);
|
||||||
|
|
||||||
|
Tessellator tessellator = Tessellator.instance;
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
tessellator.setColorRGBA_F(red, green, blue, alpha);
|
||||||
|
highlightSlot(tessellator, slot.xDisplayPosition, slot.yDisplayPosition);
|
||||||
|
tessellator.draw();
|
||||||
|
|
||||||
|
GL11.glPopAttrib();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void highlightSlot(Tessellator tessellator, int x, int y) {
|
||||||
double zLevel = 1;
|
double zLevel = 1;
|
||||||
int x2 = x + 18;
|
int x2 = x + 16;
|
||||||
int y2 = y + 18;
|
int y2 = y + 16;
|
||||||
|
|
||||||
tessellator.addVertexWithUV(x2, y, zLevel, 18 / 32.0, 0);
|
tessellator.addVertexWithUV(x2, y, zLevel, 18 / 32.0, 0);
|
||||||
tessellator.addVertexWithUV(x, y, zLevel, 0, 0);
|
tessellator.addVertexWithUV(x, y, zLevel, 0, 0);
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package com.gtnh.findit.handler;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraftforge.fluids.FluidTank;
|
||||||
|
|
||||||
|
import com.darkona.adventurebackpack.inventory.IInventoryBackpack;
|
||||||
|
import com.darkona.adventurebackpack.inventory.InventoryBackpack;
|
||||||
|
import com.darkona.adventurebackpack.item.ItemAdventureBackpack;
|
||||||
|
import com.gtnh.findit.IStackFilter;
|
||||||
|
import com.gtnh.findit.IStackFilter.AnyMultiItemFilter;
|
||||||
|
import com.gtnh.findit.IStackFilter.FluidStackFilter;
|
||||||
|
import com.gtnh.findit.IStackFilter.IStackFilterProvider;
|
||||||
|
import com.gtnh.findit.IStackFilter.InventoryStackFilter;
|
||||||
|
|
||||||
|
public class AdventureBackpackProvider implements IStackFilterProvider {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IStackFilter getFilter(EntityPlayer player, TileEntity tileEntity) {
|
||||||
|
|
||||||
|
if (tileEntity instanceof IInventoryBackpack inventory) {
|
||||||
|
return getFilter(player, inventory);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IStackFilter getFilter(EntityPlayer player, ItemStack stack) {
|
||||||
|
final Item item = stack.getItem();
|
||||||
|
|
||||||
|
if (item instanceof ItemAdventureBackpack) {
|
||||||
|
return getFilter(player, new InventoryBackpack(stack));
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private IStackFilter getFilter(EntityPlayer player, IInventoryBackpack inventory) {
|
||||||
|
final AnyMultiItemFilter filter = new AnyMultiItemFilter();
|
||||||
|
final FluidStackFilter fluidFilter = new FluidStackFilter();
|
||||||
|
|
||||||
|
filter.add(new InventoryStackFilter(player, inventory));
|
||||||
|
|
||||||
|
for (FluidTank tank : inventory.getTanksArray()) {
|
||||||
|
fluidFilter.add(tank.getFluid());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!fluidFilter.isEmpty()) {
|
||||||
|
filter.add(fluidFilter);
|
||||||
|
}
|
||||||
|
|
||||||
|
return filter;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.gtnh.findit.handler;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
|
import com.gtnh.findit.IStackFilter;
|
||||||
|
import com.gtnh.findit.IStackFilter.IStackFilterProvider;
|
||||||
|
import com.gtnh.findit.IStackFilter.InventoryStackFilter;
|
||||||
|
|
||||||
|
import de.eydamos.backpack.item.ItemBackpack;
|
||||||
|
|
||||||
|
public class BackpackProvider implements IStackFilterProvider {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IStackFilter getFilter(EntityPlayer player, TileEntity tileEntity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IStackFilter getFilter(EntityPlayer player, ItemStack stack) {
|
||||||
|
final Item item = stack.getItem();
|
||||||
|
|
||||||
|
if (item instanceof ItemBackpack) {
|
||||||
|
return new InventoryStackFilter(player, ItemBackpack.getInventory(stack, player));
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.gtnh.findit.handler;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
|
import com.brandon3055.draconicevolution.common.tileentities.TilePlacedItem;
|
||||||
|
import com.gtnh.findit.IStackFilter;
|
||||||
|
import com.gtnh.findit.IStackFilter.IStackFilterProvider;
|
||||||
|
|
||||||
|
public class DraconicEvolutionProvider implements IStackFilterProvider {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IStackFilter getFilter(EntityPlayer player, TileEntity tileEntity) {
|
||||||
|
|
||||||
|
if (tileEntity instanceof TilePlacedItem placedItem) {
|
||||||
|
final ItemStack stack = placedItem.getStack();
|
||||||
|
return request -> request.isStackSatisfies(player, stack);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IStackFilter getFilter(EntityPlayer player, ItemStack stack) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.gtnh.findit.handler;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.inventory.IInventory;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
|
import com.gtnh.findit.IStackFilter;
|
||||||
|
import com.gtnh.findit.IStackFilter.IStackFilterProvider;
|
||||||
|
import com.gtnh.findit.IStackFilter.InventoryStackFilter;
|
||||||
|
|
||||||
|
import forestry.storage.inventory.ItemInventoryBackpack;
|
||||||
|
import forestry.storage.items.ItemBackpack;
|
||||||
|
|
||||||
|
public class ForestryStackFilterProvider implements IStackFilterProvider {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IStackFilter getFilter(EntityPlayer player, TileEntity tileEntity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IStackFilter getFilter(EntityPlayer player, ItemStack stack) {
|
||||||
|
final Item item = stack.getItem();
|
||||||
|
|
||||||
|
if (item instanceof ItemBackpack backpack) {
|
||||||
|
final IInventory inventory = new ItemInventoryBackpack(player, backpack.getBackpackSize(), stack);
|
||||||
|
|
||||||
|
return new InventoryStackFilter(player, inventory);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package com.gtnh.findit.handler;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import com.gtnewhorizons.modularui.api.forge.IItemHandler;
|
||||||
|
import com.gtnh.findit.IStackFilter;
|
||||||
|
import com.gtnh.findit.IStackFilter.IStackFilterProvider;
|
||||||
|
import com.gtnh.findit.service.itemfinder.FindItemRequest;
|
||||||
|
|
||||||
|
import gregtech.api.interfaces.tileentity.ICoverable;
|
||||||
|
import gregtech.common.covers.Cover;
|
||||||
|
import gregtech.common.covers.CoverChest;
|
||||||
|
|
||||||
|
public class GregTechCoverChestProvider implements IStackFilterProvider {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IStackFilter getFilter(EntityPlayer player, TileEntity tileEntity) {
|
||||||
|
if (!(tileEntity instanceof ICoverable coverable)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return request -> {
|
||||||
|
for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) {
|
||||||
|
if (!coverable.hasCoverAtSide(side)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (coverChestMatches(player, request, coverable.getCoverAtSide(side))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IStackFilter getFilter(EntityPlayer player, ItemStack stack) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean coverChestMatches(EntityPlayer player, FindItemRequest request, Cover cover) {
|
||||||
|
if (!(cover instanceof CoverChest coverChest)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
IItemHandler items = coverChest.getItems();
|
||||||
|
for (int slot = 0; slot < items.getSlots(); slot++) {
|
||||||
|
ItemStack slotItem = items.getStackInSlot(slot);
|
||||||
|
if (slotItem != null && request.isStackSatisfies(player, slotItem)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package com.gtnh.findit.handler;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import com.gtnh.findit.IStackFilter;
|
||||||
|
import com.gtnh.findit.IStackFilter.IStackFilterProvider;
|
||||||
|
|
||||||
|
import gregtech.api.covers.CoverRegistry;
|
||||||
|
import gregtech.api.interfaces.tileentity.ICoverable;
|
||||||
|
import gregtech.api.util.GTUtility;
|
||||||
|
|
||||||
|
public class GregTechCoverProvider implements IStackFilterProvider {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IStackFilter getFilter(EntityPlayer player, TileEntity tileEntity) {
|
||||||
|
if (!(tileEntity instanceof ICoverable coverable)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return request -> {
|
||||||
|
ItemStack stackToFind = request.getStackToFind();
|
||||||
|
if (stackToFind == null || !CoverRegistry.isCover(stackToFind)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) {
|
||||||
|
if (!coverable.hasCoverAtSide(side)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
ItemStack coverStack = coverable.getCoverItemAtSide(side);
|
||||||
|
if (GTUtility.areStacksEqual(stackToFind, coverStack, true)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IStackFilter getFilter(EntityPlayer player, ItemStack stack) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.gtnh.findit.handler;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.inventory.IInventory;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
|
import net.minecraftforge.fluids.FluidTankInfo;
|
||||||
|
import net.minecraftforge.fluids.IFluidHandler;
|
||||||
|
import net.minecraftforge.fluids.IFluidTank;
|
||||||
|
|
||||||
|
import com.gtnh.findit.IStackFilter;
|
||||||
|
import com.gtnh.findit.IStackFilter.AnyMultiItemFilter;
|
||||||
|
import com.gtnh.findit.IStackFilter.FluidStackFilter;
|
||||||
|
import com.gtnh.findit.IStackFilter.IStackFilterProvider;
|
||||||
|
import com.gtnh.findit.IStackFilter.InventoryStackFilter;
|
||||||
|
|
||||||
|
import codechicken.nei.recipe.StackInfo;
|
||||||
|
|
||||||
|
public class MinecraftProvider implements IStackFilterProvider {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IStackFilter getFilter(EntityPlayer player, TileEntity tileEntity) {
|
||||||
|
AnyMultiItemFilter anyFilter = new AnyMultiItemFilter();
|
||||||
|
|
||||||
|
if (tileEntity instanceof IInventory inventory) {
|
||||||
|
anyFilter.add(new InventoryStackFilter(player, inventory));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tileEntity instanceof IFluidTank tank) {
|
||||||
|
anyFilter.add(new FluidStackFilter(tank.getFluid()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tileEntity instanceof IFluidHandler handler) {
|
||||||
|
FluidTankInfo[] tankInfo = handler.getTankInfo(ForgeDirection.UNKNOWN);
|
||||||
|
FluidStackFilter filter = new FluidStackFilter();
|
||||||
|
if (tankInfo != null) {
|
||||||
|
for (FluidTankInfo info : tankInfo) {
|
||||||
|
filter.add(info.fluid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!filter.isEmpty()) anyFilter.add(filter);
|
||||||
|
}
|
||||||
|
|
||||||
|
return anyFilter.isEmpty() ? null : anyFilter;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IStackFilter getFilter(EntityPlayer player, ItemStack stack) {
|
||||||
|
AnyMultiItemFilter filter = new AnyMultiItemFilter();
|
||||||
|
|
||||||
|
final FluidStack fluid = StackInfo.getFluid(stack);
|
||||||
|
|
||||||
|
if (fluid != null) {
|
||||||
|
filter.add(new FluidStackFilter(fluid));
|
||||||
|
}
|
||||||
|
|
||||||
|
filter.add(request -> StackInfo.equalItemAndNBT(request.getStackToFind(), stack, true));
|
||||||
|
|
||||||
|
return filter.isEmpty() ? null : filter;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.gtnh.findit.handler;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
|
import com.gtnh.findit.IStackFilter;
|
||||||
|
import com.gtnh.findit.IStackFilter.IStackFilterProvider;
|
||||||
|
import com.gtnh.findit.IStackFilter.InventoryStackFilter;
|
||||||
|
|
||||||
|
import mrtjp.core.inventory.SimpleInventory;
|
||||||
|
import mrtjp.projectred.exploration.ItemBackpack;
|
||||||
|
|
||||||
|
public class ProjectRedExplorationProvider implements IStackFilterProvider {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IStackFilter getFilter(EntityPlayer player, TileEntity tileEntity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IStackFilter getFilter(EntityPlayer player, ItemStack stack) {
|
||||||
|
final Item item = stack.getItem();
|
||||||
|
|
||||||
|
if (item instanceof ItemBackpack) {
|
||||||
|
SimpleInventory inventory = new SimpleInventory(27, "", 64);
|
||||||
|
inventory.loadInv(ItemBackpack.getBagTag(stack));
|
||||||
|
|
||||||
|
return new InventoryStackFilter(player, inventory);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
package com.gtnh.findit.handler;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
|
import com.gtnewhorizons.aspectrecipeindex.common.items.ItemAspect;
|
||||||
|
import com.gtnh.findit.IStackFilter;
|
||||||
|
import com.gtnh.findit.IStackFilter.IStackFilterProvider;
|
||||||
|
import com.gtnh.findit.service.itemfinder.FindItemRequest;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.Loader;
|
||||||
|
import thaumcraft.api.aspects.Aspect;
|
||||||
|
import thaumcraft.api.aspects.AspectList;
|
||||||
|
import thaumcraft.api.aspects.IAspectContainer;
|
||||||
|
import thaumcraft.api.aspects.IEssentiaContainerItem;
|
||||||
|
|
||||||
|
public class ThaumcraftProvider implements IStackFilterProvider {
|
||||||
|
|
||||||
|
public static final boolean ASPECTRECIPEINDEX = Loader.isModLoaded("aspectrecipeindex");
|
||||||
|
public static final boolean TCNEIPLUGIN = Loader.isModLoaded("thaumcraftneiplugin");
|
||||||
|
|
||||||
|
static class AspectStackFilter implements IStackFilter {
|
||||||
|
|
||||||
|
AspectList filterAspects;
|
||||||
|
|
||||||
|
AspectStackFilter(AspectList filterAspects) {
|
||||||
|
this.filterAspects = filterAspects;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean matches(FindItemRequest request) {
|
||||||
|
ItemStack stack = request.getStackToFind();
|
||||||
|
Item item = stack.getItem();
|
||||||
|
if (item instanceof IEssentiaContainerItem container) {
|
||||||
|
AspectList stackAspects = container.getAspects(stack);
|
||||||
|
if (stackAspects == null || stackAspects.aspects.isEmpty()) return false;
|
||||||
|
for (Aspect a : stackAspects.getAspects()) {
|
||||||
|
if (filterAspects.getAmount(a) > 0) return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Aspect aspect;
|
||||||
|
if (ASPECTRECIPEINDEX && item instanceof ItemAspect) {
|
||||||
|
aspect = ItemAspect.getAspect(stack);
|
||||||
|
} else if (TCNEIPLUGIN && item instanceof com.djgiannuzz.thaumcraftneiplugin.items.ItemAspect) {
|
||||||
|
AspectList stackAspects = com.djgiannuzz.thaumcraftneiplugin.items.ItemAspect.getAspects(stack);
|
||||||
|
if (stackAspects == null || stackAspects.aspects.isEmpty()) return false;
|
||||||
|
aspect = stackAspects.getAspects()[0];
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return filterAspects.getAmount(aspect) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IStackFilter getFilter(EntityPlayer player, TileEntity tileEntity) {
|
||||||
|
if (!(tileEntity instanceof IAspectContainer aspectContainer)) return null;
|
||||||
|
AspectList aspects = aspectContainer.getAspects();
|
||||||
|
if (aspects == null) return null;
|
||||||
|
return new AspectStackFilter(aspects);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IStackFilter getFilter(EntityPlayer player, ItemStack stack) {
|
||||||
|
if (!(stack.getItem() instanceof IEssentiaContainerItem containerItem)) return null;
|
||||||
|
AspectList aspects = containerItem.getAspects(stack);
|
||||||
|
if (aspects == null) return null;
|
||||||
|
return new AspectStackFilter(aspects);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,25 +1,27 @@
|
|||||||
package com.gtnh.findit.service.blockfinder;
|
package com.gtnh.findit.service.blockfinder;
|
||||||
|
|
||||||
import com.gtnh.findit.FindIt;
|
import java.util.ArrayList;
|
||||||
import com.gtnh.findit.FindItConfig;
|
import java.util.List;
|
||||||
import com.gtnh.findit.FindItNetwork;
|
|
||||||
import com.gtnh.findit.util.WorldUtils;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.ChunkPosition;
|
import net.minecraft.world.ChunkPosition;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import com.gtnh.findit.FindIt;
|
||||||
import java.util.List;
|
import com.gtnh.findit.FindItConfig;
|
||||||
|
import com.gtnh.findit.FindItNetwork;
|
||||||
|
import com.gtnh.findit.util.WorldUtils;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
|
||||||
public class BlockFindService {
|
public class BlockFindService {
|
||||||
|
|
||||||
public BlockFindService() {
|
public BlockFindService() {
|
||||||
FindItNetwork.registerMessage(FindBlockRequest.Handler.class, FindBlockRequest.class, Side.SERVER);
|
FindItNetwork.registerMessage(FindBlockRequest.Handler.class, FindBlockRequest.class, Side.SERVER);
|
||||||
FindItNetwork.registerMessage(BlockFoundResponse.Handler.class, BlockFoundResponse.class, Side.CLIENT);
|
FindItNetwork.registerMessage(BlockFoundResponse.Handler.class, BlockFoundResponse.class, Side.CLIENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleRequest(EntityPlayerMP player, FindBlockRequest request) {
|
public void handleRequest(EntityPlayerMP player, FindBlockRequest request) {
|
||||||
if (FindIt.getCooldownService().checkSearchCooldown(player)) {
|
if (FindIt.getCooldownService().checkSearchCooldown(player)) {
|
||||||
return;
|
return;
|
||||||
@@ -29,16 +31,16 @@ public class BlockFindService {
|
|||||||
for (TileEntity tileEntity : WorldUtils.getTileEntitiesAround(player, FindItConfig.SEARCH_RADIUS)) {
|
for (TileEntity tileEntity : WorldUtils.getTileEntitiesAround(player, FindItConfig.SEARCH_RADIUS)) {
|
||||||
try {
|
try {
|
||||||
Block tileBlock = tileEntity.getBlockType();
|
Block tileBlock = tileEntity.getBlockType();
|
||||||
|
|
||||||
if (!request.getBlockToFind().equals(tileBlock)) {
|
if (!request.getBlockToFind().equals(tileBlock)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
int tileMeta;
|
int tileMeta = tileBlock.getDamageValue(
|
||||||
if (tileEntity instanceof IGregTechTileEntity) {
|
tileEntity.getWorldObj(),
|
||||||
tileMeta = ((IGregTechTileEntity) tileEntity).getMetaTileID();
|
tileEntity.xCoord,
|
||||||
} else {
|
tileEntity.yCoord,
|
||||||
tileMeta = tileEntity.getBlockMetadata();
|
tileEntity.zCoord);
|
||||||
}
|
|
||||||
|
|
||||||
if (request.getMetaToFind() == tileMeta) {
|
if (request.getMetaToFind() == tileMeta) {
|
||||||
positions.add(new ChunkPosition(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord));
|
positions.add(new ChunkPosition(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord));
|
||||||
@@ -51,8 +53,6 @@ public class BlockFindService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!positions.isEmpty()) {
|
FindItNetwork.CHANNEL.sendTo(new BlockFoundResponse(positions), player);
|
||||||
FindItNetwork.CHANNEL.sendTo(new BlockFoundResponse(positions), player);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,18 @@
|
|||||||
package com.gtnh.findit.service.blockfinder;
|
package com.gtnh.findit.service.blockfinder;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.world.ChunkPosition;
|
||||||
|
|
||||||
import com.gtnh.findit.util.ProtoUtils;
|
import com.gtnh.findit.util.ProtoUtils;
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.world.ChunkPosition;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class BlockFoundResponse implements IMessage {
|
public class BlockFoundResponse implements IMessage {
|
||||||
|
|
||||||
@@ -20,8 +22,7 @@ public class BlockFoundResponse implements IMessage {
|
|||||||
this.positions = positions;
|
this.positions = positions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BlockFoundResponse() {
|
public BlockFoundResponse() {}
|
||||||
}
|
|
||||||
|
|
||||||
public List<ChunkPosition> getPositions() {
|
public List<ChunkPosition> getPositions() {
|
||||||
return positions;
|
return positions;
|
||||||
|
|||||||
@@ -1,28 +1,65 @@
|
|||||||
package com.gtnh.findit.service.blockfinder;
|
package com.gtnh.findit.service.blockfinder;
|
||||||
|
|
||||||
import codechicken.nei.NEIClientUtils;
|
import static com.gtnh.findit.util.ClientFinderHelperUtils.lookAtTarget;
|
||||||
import codechicken.nei.api.API;
|
|
||||||
import codechicken.nei.guihook.GuiContainerManager;
|
|
||||||
import com.gtnh.findit.FindIt;
|
|
||||||
import com.gtnh.findit.FindItNetwork;
|
|
||||||
import com.gtnh.findit.fx.ParticlePosition;
|
|
||||||
import com.gtnh.findit.util.AbstractStackFinder;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||||
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
|
||||||
import org.lwjgl.input.Keyboard;
|
import org.lwjgl.input.Keyboard;
|
||||||
|
|
||||||
|
import com.gtnh.findit.FindIt;
|
||||||
|
import com.gtnh.findit.FindItConfig;
|
||||||
|
import com.gtnh.findit.FindItNetwork;
|
||||||
|
import com.gtnh.findit.fx.BlockHighlighter;
|
||||||
|
import com.gtnh.findit.fx.ParticlePosition;
|
||||||
|
import com.gtnh.findit.util.AbstractStackFinder;
|
||||||
|
|
||||||
|
import codechicken.nei.api.API;
|
||||||
|
import codechicken.nei.guihook.GuiContainerManager;
|
||||||
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
|
||||||
public class ClientBlockFindService extends BlockFindService {
|
public class ClientBlockFindService extends BlockFindService {
|
||||||
|
|
||||||
|
private final BlockHighlighter blockHighlighter;
|
||||||
|
|
||||||
public ClientBlockFindService() {
|
public ClientBlockFindService() {
|
||||||
API.addHashBind("gui.findit.find_block", Keyboard.KEY_Y + NEIClientUtils.SHIFT_HASH);
|
this.blockHighlighter = new BlockHighlighter();
|
||||||
|
|
||||||
|
API.addHashBind("gui.findit.find_block", Keyboard.KEY_Y);
|
||||||
GuiContainerManager.addInputHandler(new BlockFindInputHandler());
|
GuiContainerManager.addInputHandler(new BlockFindInputHandler());
|
||||||
|
|
||||||
|
MinecraftForge.EVENT_BUS.register(new WorldRenderListener());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleResponse(EntityClientPlayerMP player, BlockFoundResponse response) {
|
public void handleResponse(EntityClientPlayerMP player, BlockFoundResponse response) {
|
||||||
player.closeScreen();
|
|
||||||
ParticlePosition.highlightBlocks(player.worldObj, response.getPositions());
|
if (!response.getPositions().isEmpty()) {
|
||||||
|
player.closeScreen();
|
||||||
|
|
||||||
|
if (FindItConfig.ENABLE_ROTATE_VIEW) {
|
||||||
|
lookAtTarget(player, response);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FindItConfig.USE_PARTICLE_HIGHLIGHTER) {
|
||||||
|
ParticlePosition.highlightBlocks(player.worldObj, response.getPositions());
|
||||||
|
} else {
|
||||||
|
this.blockHighlighter.highlightBlocks(
|
||||||
|
response.getPositions(),
|
||||||
|
System.currentTimeMillis() + FindItConfig.BLOCK_HIGHLIGHTING_DURATION * 1000L);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class WorldRenderListener {
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void renderWorldLastEvent(RenderWorldLastEvent event) {
|
||||||
|
blockHighlighter.renderHighlightedBlock(event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class BlockFindInputHandler extends AbstractStackFinder {
|
private static class BlockFindInputHandler extends AbstractStackFinder {
|
||||||
@@ -35,6 +72,7 @@ public class ClientBlockFindService extends BlockFindService {
|
|||||||
@Override
|
@Override
|
||||||
protected boolean findStack(ItemStack stack) {
|
protected boolean findStack(ItemStack stack) {
|
||||||
Block block = Block.getBlockFromItem(stack.getItem());
|
Block block = Block.getBlockFromItem(stack.getItem());
|
||||||
|
|
||||||
if (block == Blocks.air) {
|
if (block == Blocks.air) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
package com.gtnh.findit.service.blockfinder;
|
package com.gtnh.findit.service.blockfinder;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
|
||||||
import com.gtnh.findit.FindIt;
|
import com.gtnh.findit.FindIt;
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
|
|
||||||
public class FindBlockRequest implements IMessage {
|
public class FindBlockRequest implements IMessage {
|
||||||
|
|
||||||
@@ -18,8 +20,7 @@ public class FindBlockRequest implements IMessage {
|
|||||||
this.metaToFind = meta;
|
this.metaToFind = meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
public FindBlockRequest() {
|
public FindBlockRequest() {}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void fromBytes(ByteBuf buf) {
|
public void fromBytes(ByteBuf buf) {
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package com.gtnh.findit.service.cooldown;
|
package com.gtnh.findit.service.cooldown;
|
||||||
|
|
||||||
import com.gtnh.findit.FindItConfig;
|
import java.util.WeakHashMap;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
|
|
||||||
import java.util.WeakHashMap;
|
import com.gtnh.findit.FindItConfig;
|
||||||
|
|
||||||
public class SearchCooldownService {
|
public class SearchCooldownService {
|
||||||
|
|
||||||
|
|||||||
@@ -1,96 +1,160 @@
|
|||||||
package com.gtnh.findit.service.itemfinder;
|
package com.gtnh.findit.service.itemfinder;
|
||||||
|
|
||||||
import codechicken.nei.NEIClientUtils;
|
import java.util.ArrayList;
|
||||||
import codechicken.nei.api.API;
|
import java.util.HashSet;
|
||||||
import codechicken.nei.guihook.GuiContainerManager;
|
import java.util.List;
|
||||||
import com.gtnh.findit.FindIt;
|
|
||||||
import com.gtnh.findit.FindItNetwork;
|
|
||||||
import com.gtnh.findit.fx.ParticlePosition;
|
|
||||||
import com.gtnh.findit.fx.SlotHighlighter;
|
|
||||||
import com.gtnh.findit.util.AbstractStackFinder;
|
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
|
||||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||||
import net.minecraft.client.multiplayer.WorldClient;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
import net.minecraft.inventory.Slot;
|
import net.minecraft.inventory.Slot;
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
|
||||||
import org.lwjgl.input.Keyboard;
|
import org.lwjgl.input.Keyboard;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import com.gtnh.findit.FindIt;
|
||||||
import java.util.List;
|
import com.gtnh.findit.FindItConfig;
|
||||||
|
import com.gtnh.findit.FindItNetwork;
|
||||||
|
import com.gtnh.findit.fx.EntityHighlighter;
|
||||||
|
import com.gtnh.findit.fx.SlotHighlighter;
|
||||||
|
import com.gtnh.findit.util.AbstractStackFinder;
|
||||||
|
|
||||||
|
import codechicken.nei.api.API;
|
||||||
|
import codechicken.nei.event.NEIConfigsLoadedEvent;
|
||||||
|
import codechicken.nei.guihook.GuiContainerManager;
|
||||||
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||||
|
|
||||||
public class ClientItemFindService extends ItemFindService {
|
public class ClientItemFindService extends ItemFindService {
|
||||||
|
|
||||||
private ContainerHighlightData highlightData = null;
|
private final SlotHighlighter slotHighlighter;
|
||||||
|
private final EntityHighlighter itemEntitiesHighlighter;
|
||||||
|
|
||||||
|
private FindItemRequest foundItem = null;
|
||||||
|
private long expirationTime = 0;
|
||||||
|
|
||||||
public ClientItemFindService() {
|
public ClientItemFindService() {
|
||||||
if (!FindIt.isExtraUtilitiesLoaded()) {
|
if (!FindIt.isExtraUtilitiesLoaded()) {
|
||||||
API.addHashBind("gui.findit.find_item", Keyboard.KEY_T + NEIClientUtils.SHIFT_HASH);
|
API.addHashBind("gui.findit.find_item", Keyboard.KEY_T);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.slotHighlighter = new SlotHighlighter();
|
||||||
|
this.itemEntitiesHighlighter = new EntityHighlighter();
|
||||||
|
|
||||||
|
GuiContainerManager.addDrawHandler(this.slotHighlighter);
|
||||||
GuiContainerManager.addInputHandler(new ItemFindInputHandler());
|
GuiContainerManager.addInputHandler(new ItemFindInputHandler());
|
||||||
|
|
||||||
MinecraftForge.EVENT_BUS.register(new GuiListener());
|
MinecraftForge.EVENT_BUS.register(new NEIEventListener());
|
||||||
|
MinecraftForge.EVENT_BUS.register(new WorldRenderListener());
|
||||||
FMLCommonHandler.instance().bus().register(new TickListener());
|
FMLCommonHandler.instance().bus().register(new TickListener());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleResponse(EntityClientPlayerMP player, ItemFoundResponse response) {
|
public void handleResponse(EntityClientPlayerMP player, ItemFoundResponse response) {
|
||||||
World world = player.worldObj;
|
this.slotHighlighter.highlightSlots(null, new HashSet<>(), 0xFFFF8726);
|
||||||
|
this.foundItem = response.getFoundStack() != null ? new FindItemRequest(response.getFoundStack()) : null;
|
||||||
|
this.expirationTime = System.currentTimeMillis() + FindItConfig.ITEM_HIGHLIGHTING_DURATION * 1000L;
|
||||||
|
|
||||||
player.closeScreen();
|
if (foundItem == null || !FindItConfig.SEARCH_ITEMS_ON_GROUND) {
|
||||||
ParticlePosition.highlightBlocks(world, response.getPositions());
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleSlotHighlight(HighlightSlotsPacket packet) {
|
int searchRadius = FindItConfig.SEARCH_RADIUS;
|
||||||
highlightData = new ContainerHighlightData(packet.getWindowId(), packet.getTargetStack(), packet.getTargetSlots());
|
AxisAlignedBB searchBox = AxisAlignedBB
|
||||||
|
.getBoundingBox(player.posX, player.posY, player.posZ, player.posX, player.posY, player.posZ)
|
||||||
|
.expand(searchRadius, searchRadius, searchRadius);
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
List<EntityItem> itemEntities = player.worldObj.getEntitiesWithinAABB(EntityItem.class, searchBox);
|
||||||
|
List<Integer> foundItemEntities = new ArrayList<>();
|
||||||
|
|
||||||
|
for (EntityItem itemEntity : itemEntities) {
|
||||||
|
if (foundItem.isStackSatisfies(player, itemEntity.getEntityItem())) {
|
||||||
|
foundItemEntities.add(itemEntity.getEntityId());
|
||||||
|
if (foundItemEntities.size() >= FindItConfig.MAX_RESPONSE_SIZE) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.itemEntitiesHighlighter.highlightEntities(foundItemEntities, expirationTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TickListener {
|
public class TickListener {
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onClientPostTick(TickEvent.ClientTickEvent event) {
|
public void onClientPostTick(TickEvent.ClientTickEvent event) {
|
||||||
if (event.phase != TickEvent.Phase.END) {
|
|
||||||
|
if (foundItem == null || event.phase != TickEvent.Phase.END) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
WorldClient world = Minecraft.getMinecraft().theWorld;
|
|
||||||
if (world == null) {
|
// `WorldClient` is only available on the client-side, thus effectively checking if the game is running on
|
||||||
|
// the client. We are only interested in highlighting slots when the player is in a GUI; the operation is
|
||||||
|
// bound client-side.
|
||||||
|
if (Minecraft.getMinecraft().theWorld == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GuiScreen screen = Minecraft.getMinecraft().currentScreen;
|
|
||||||
|
// We are only interested in GUIs that contain some kind of inventory.
|
||||||
|
final GuiScreen screen = Minecraft.getMinecraft().currentScreen;
|
||||||
if (!(screen instanceof GuiContainer)) {
|
if (!(screen instanceof GuiContainer)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GuiContainer gui = (GuiContainer) screen;
|
|
||||||
|
|
||||||
if (highlightData != null) {
|
final GuiContainer gui = (GuiContainer) screen;
|
||||||
if (highlightData.windowId == gui.inventorySlots.windowId) {
|
final HashSet<Slot> highlightedSlots = new HashSet<>();
|
||||||
highlightData.updateHighlightedSlots(gui);
|
|
||||||
} else {
|
// If the expiration time has passed, we reset the found item. This is done to prevent the item from being
|
||||||
highlightData = null;
|
// highlighted indefinitely.
|
||||||
|
if (System.currentTimeMillis() > expirationTime) {
|
||||||
|
foundItem = null;
|
||||||
|
}
|
||||||
|
if (foundItem == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// We continue to iterate over each slot of the given GUI's inventory and checking if the slot contains the
|
||||||
|
// item that we are looking for.
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
List<Slot> slots = gui.inventorySlots.inventorySlots;
|
||||||
|
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||||
|
|
||||||
|
for (Slot slot : slots) {
|
||||||
|
if (!(slot.inventory instanceof InventoryPlayer)
|
||||||
|
&& foundItem.isStackSatisfies(player, slot.getStack())) {
|
||||||
|
highlightedSlots.add(slot);
|
||||||
|
|
||||||
|
if (highlightedSlots.size() > 256) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
slotHighlighter.highlightSlots(gui, highlightedSlots, getItemHighlightingColor());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GuiListener {
|
private static int getItemHighlightingColor() {
|
||||||
|
try {
|
||||||
|
return Integer.parseUnsignedInt(FindItConfig.ITEM_HIGHLIGHTING_COLOR, 16);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
return 0xFFFF8726;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class WorldRenderListener {
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onGuiPostRender(GuiScreenEvent.DrawScreenEvent.Pre event) {
|
public void renderWorldLastEvent(RenderWorldLastEvent event) {
|
||||||
if (!(event.gui instanceof GuiContainer)) {
|
itemEntitiesHighlighter.renderHighlightedEntities(event);
|
||||||
return;
|
|
||||||
}
|
|
||||||
GuiContainer gui = (GuiContainer) event.gui;
|
|
||||||
|
|
||||||
if (highlightData != null && highlightData.windowId == gui.inventorySlots.windowId) {
|
|
||||||
SlotHighlighter.highlightSlots(gui, highlightData.highlightedSlots, 0xFFFF8726);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,39 +172,25 @@ public class ClientItemFindService extends ItemFindService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class ContainerHighlightData {
|
/**
|
||||||
private final int windowId;
|
* This class is responsible for removing the NEI ping handler from the list of input handlers. This is done to
|
||||||
private final ItemStack targetStack;
|
* prevent the NEI ping handler from interfering with the FindIt keybind.
|
||||||
private final List<Integer> targetSlots;
|
*/
|
||||||
private final List<Integer> highlightedSlots = new ArrayList<>();
|
public static class NEIEventListener {
|
||||||
|
|
||||||
public ContainerHighlightData(int windowId, ItemStack targetStack, List<Integer> targetSlots) {
|
@SubscribeEvent
|
||||||
this.windowId = windowId;
|
public void onNEIConfigsLoaded(NEIConfigsLoadedEvent event) {
|
||||||
this.targetStack = targetStack;
|
if (FindIt.isExtraUtilitiesLoaded()) {
|
||||||
this.targetSlots = targetSlots;
|
GuiContainerManager.inputHandlers.removeIf(
|
||||||
}
|
(inputHandler) -> inputHandler.getClass().getName()
|
||||||
|
.equals("com.rwtema.extrautils.nei.ping.NEIPing"));
|
||||||
public void updateHighlightedSlots(GuiContainer gui) {
|
|
||||||
highlightedSlots.clear();
|
|
||||||
|
|
||||||
List<Slot> slots = (List<Slot>) gui.inventorySlots.inventorySlots;
|
|
||||||
Item targetItem = targetStack.getItem();
|
|
||||||
int targetMeta = targetStack.getItemDamage();
|
|
||||||
|
|
||||||
for (int slotId : targetSlots) {
|
|
||||||
if (slotId >= slots.size()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
Slot slot = slots.get(slotId);
|
|
||||||
ItemStack stack = slot.getStack();
|
|
||||||
if (stack != null && stack.getItem() == targetItem && stack.getItemDamage() == targetMeta) {
|
|
||||||
highlightedSlots.add(slotId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the instance of the client item find service.
|
||||||
|
*/
|
||||||
public static ClientItemFindService getInstance() {
|
public static ClientItemFindService getInstance() {
|
||||||
return (ClientItemFindService) FindIt.getItemFindService();
|
return (ClientItemFindService) FindIt.getItemFindService();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,44 +1,109 @@
|
|||||||
package com.gtnh.findit.service.itemfinder;
|
package com.gtnh.findit.service.itemfinder;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraftforge.fluids.FluidRegistry;
|
||||||
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
|
|
||||||
import com.gtnh.findit.FindIt;
|
import com.gtnh.findit.FindIt;
|
||||||
|
import com.gtnh.findit.FindItConfig;
|
||||||
|
import com.gtnh.findit.IStackFilter;
|
||||||
|
import com.gtnh.findit.IStackFilter.IStackFilterProvider;
|
||||||
import com.gtnh.findit.service.blockfinder.BlockFoundResponse;
|
import com.gtnh.findit.service.blockfinder.BlockFoundResponse;
|
||||||
import com.gtnh.findit.util.ProtoUtils;
|
import com.gtnh.findit.util.ProtoUtils;
|
||||||
|
|
||||||
|
import codechicken.nei.recipe.StackInfo;
|
||||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||||
|
import crazypants.enderio.conduit.TileConduitBundle;
|
||||||
|
import gregtech.api.metatileentity.BaseMetaPipeEntity;
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
|
|
||||||
public class FindItemRequest implements IMessage {
|
public class FindItemRequest implements IMessage {
|
||||||
|
|
||||||
private ItemStack stack;
|
private ItemStack targetStack;
|
||||||
|
private FluidStack targetFluidStack;
|
||||||
|
private boolean highlightingEmptyItemStacks;
|
||||||
|
private boolean searchInGTPipes;
|
||||||
|
private boolean searchConduits;
|
||||||
|
|
||||||
public FindItemRequest(ItemStack stack) {
|
public FindItemRequest(ItemStack targetStack) {
|
||||||
this.stack = stack;
|
this.targetStack = targetStack;
|
||||||
|
this.targetFluidStack = StackInfo.getFluid(targetStack);
|
||||||
|
this.highlightingEmptyItemStacks = FindItConfig.ITEM_HIGHLIGHTING_EMPTY_ITEMSTACKS;
|
||||||
|
this.searchInGTPipes = FindItConfig.SEARCH_IN_GT_PIPES;
|
||||||
|
this.searchConduits = FindItConfig.SEARCH_IN_ENDERIO_CONDUITS;
|
||||||
}
|
}
|
||||||
|
|
||||||
public FindItemRequest() {
|
public FindItemRequest() {}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void fromBytes(ByteBuf buf) {
|
public void fromBytes(ByteBuf buf) {
|
||||||
stack = ProtoUtils.readItemStack(buf);
|
this.targetStack = ProtoUtils.readItemStack(buf);
|
||||||
|
this.targetFluidStack = StackInfo.getFluid(targetStack);
|
||||||
|
this.highlightingEmptyItemStacks = buf.readBoolean();
|
||||||
|
this.searchInGTPipes = buf.readBoolean();
|
||||||
|
this.searchConduits = buf.readBoolean();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void toBytes(ByteBuf buf) {
|
public void toBytes(ByteBuf buf) {
|
||||||
ProtoUtils.writeItemStack(buf, stack);
|
ProtoUtils.writeItemStack(buf, this.targetStack);
|
||||||
|
buf.writeBoolean(this.highlightingEmptyItemStacks);
|
||||||
|
buf.writeBoolean(this.searchInGTPipes);
|
||||||
|
buf.writeBoolean(this.searchConduits);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getStackToFind() {
|
public ItemStack getStackToFind() {
|
||||||
return stack;
|
return this.targetStack;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isFluidSatisfies(FluidStack fluid) {
|
||||||
|
if (fluid == null || !this.highlightingEmptyItemStacks && fluid.amount == 0) return false;
|
||||||
|
if (fluid.getFluid() == FluidRegistry.WATER && fluid.amount == 0) return false;
|
||||||
|
|
||||||
|
return this.targetFluidStack != null && this.targetFluidStack.isFluidEqual(fluid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isStackSatisfies(EntityPlayer player, ItemStack stack) {
|
||||||
|
if (stack == null || !this.highlightingEmptyItemStacks && stack.stackSize == 0) return false;
|
||||||
|
|
||||||
|
for (IStackFilterProvider provider : FindIt.INSTANCE.pluginsList) {
|
||||||
|
IStackFilter filter = provider.getFilter(player, stack);
|
||||||
|
if (filter != null && filter.matches(this)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isTileSatisfies(EntityPlayer player, TileEntity tileEntity) {
|
||||||
|
if (FindIt.isGregTechLoaded() && !this.searchInGTPipes && tileEntity instanceof BaseMetaPipeEntity) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FindIt.isEnderIOLoaded() && !this.searchConduits && tileEntity instanceof TileConduitBundle) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (IStackFilterProvider provider : FindIt.INSTANCE.pluginsList) {
|
||||||
|
IStackFilter filter = provider.getFilter(player, tileEntity);
|
||||||
|
if (filter != null && filter.matches(this)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Handler implements IMessageHandler<FindItemRequest, BlockFoundResponse> {
|
public static class Handler implements IMessageHandler<FindItemRequest, BlockFoundResponse> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockFoundResponse onMessage(FindItemRequest message, MessageContext ctx) {
|
public BlockFoundResponse onMessage(FindItemRequest message, MessageContext ctx) {
|
||||||
if (message.stack != null) {
|
if (message.targetStack != null) {
|
||||||
FindIt.getItemFindService().handleRequest(ctx.getServerHandler().playerEntity, message);
|
FindIt.getItemFindService().handleRequest(ctx.getServerHandler().playerEntity, message);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -1,72 +0,0 @@
|
|||||||
package com.gtnh.findit.service.itemfinder;
|
|
||||||
|
|
||||||
import com.gtnh.findit.service.blockfinder.BlockFoundResponse;
|
|
||||||
import com.gtnh.findit.util.ProtoUtils;
|
|
||||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
|
||||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
|
||||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
|
||||||
import io.netty.buffer.ByteBuf;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class HighlightSlotsPacket implements IMessage {
|
|
||||||
|
|
||||||
private int windowId;
|
|
||||||
private ItemStack targetStack;
|
|
||||||
private List<Integer> targetSlots;
|
|
||||||
|
|
||||||
public HighlightSlotsPacket(int windowId, ItemStack targetStack, List<Integer> targetSlots) {
|
|
||||||
this.windowId = windowId;
|
|
||||||
this.targetStack = targetStack;
|
|
||||||
this.targetSlots = targetSlots;
|
|
||||||
}
|
|
||||||
|
|
||||||
public HighlightSlotsPacket() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void fromBytes(ByteBuf buf) {
|
|
||||||
windowId = buf.readInt();
|
|
||||||
targetStack = ProtoUtils.readItemStack(buf);
|
|
||||||
|
|
||||||
int slotCount = buf.readInt();
|
|
||||||
targetSlots = new ArrayList<>(slotCount);
|
|
||||||
for (int i = 0; i < slotCount; i++) {
|
|
||||||
targetSlots.add((int) buf.readShort());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void toBytes(ByteBuf buf) {
|
|
||||||
buf.writeInt(windowId);
|
|
||||||
ProtoUtils.writeItemStack(buf, targetStack);
|
|
||||||
|
|
||||||
buf.writeInt(targetSlots.size());
|
|
||||||
targetSlots.forEach(buf::writeShort);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getWindowId() {
|
|
||||||
return windowId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemStack getTargetStack() {
|
|
||||||
return targetStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Integer> getTargetSlots() {
|
|
||||||
return targetSlots;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Handler implements IMessageHandler<HighlightSlotsPacket, BlockFoundResponse> {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BlockFoundResponse onMessage(HighlightSlotsPacket message, MessageContext ctx) {
|
|
||||||
if (message.getTargetStack() != null) {
|
|
||||||
ClientItemFindService.getInstance().handleSlotHighlight(message);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,46 +1,25 @@
|
|||||||
package com.gtnh.findit.service.itemfinder;
|
package com.gtnh.findit.service.itemfinder;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.world.ChunkPosition;
|
||||||
|
|
||||||
import com.gtnh.findit.FindIt;
|
import com.gtnh.findit.FindIt;
|
||||||
import com.gtnh.findit.FindItConfig;
|
import com.gtnh.findit.FindItConfig;
|
||||||
import com.gtnh.findit.FindItNetwork;
|
import com.gtnh.findit.FindItNetwork;
|
||||||
|
import com.gtnh.findit.service.blockfinder.BlockFoundResponse;
|
||||||
import com.gtnh.findit.util.WorldUtils;
|
import com.gtnh.findit.util.WorldUtils;
|
||||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
|
||||||
import net.minecraft.inventory.Container;
|
|
||||||
import net.minecraft.inventory.IInventory;
|
|
||||||
import net.minecraft.inventory.InventoryLargeChest;
|
|
||||||
import net.minecraft.inventory.Slot;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraft.world.ChunkPosition;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
|
||||||
import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent;
|
|
||||||
|
|
||||||
import java.util.*;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
|
||||||
public class ItemFindService {
|
public class ItemFindService {
|
||||||
|
|
||||||
private final Map<EntityPlayerMP, ItemFoundResult> lastResults = new HashMap<>();
|
|
||||||
private final Map<EntityPlayerMP, Integer> lastProcessedContainers = new HashMap<>(); // (player) -> (windowId)
|
|
||||||
|
|
||||||
public ItemFindService() {
|
public ItemFindService() {
|
||||||
FindItNetwork.registerMessage(FindItemRequest.Handler.class, FindItemRequest.class, Side.SERVER);
|
FindItNetwork.registerMessage(FindItemRequest.Handler.class, FindItemRequest.class, Side.SERVER);
|
||||||
FindItNetwork.registerMessage(ItemFoundResponse.Handler.class, ItemFoundResponse.class, Side.CLIENT);
|
FindItNetwork.registerMessage(ItemFoundResponse.Handler.class, ItemFoundResponse.class, Side.CLIENT);
|
||||||
FindItNetwork.registerMessage(HighlightSlotsPacket.Handler.class, HighlightSlotsPacket.class, Side.CLIENT);
|
|
||||||
|
|
||||||
MinecraftForge.EVENT_BUS.register(new ContainerListener());
|
|
||||||
}
|
|
||||||
|
|
||||||
private ItemFoundResult getLastFoundResult(EntityPlayerMP player) {
|
|
||||||
ItemFoundResult lastResult = lastResults.get(player);
|
|
||||||
if (lastResult != null && !lastResult.isValid(player.getEntityWorld())) {
|
|
||||||
lastResults.remove(player);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return lastResult;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleRequest(EntityPlayerMP player, FindItemRequest request) {
|
public void handleRequest(EntityPlayerMP player, FindItemRequest request) {
|
||||||
@@ -48,30 +27,13 @@ public class ItemFindService {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Item itemToFind = request.getStackToFind().getItem();
|
|
||||||
int metaToFind = request.getStackToFind().getItemDamage();
|
|
||||||
|
|
||||||
List<ChunkPosition> positions = new ArrayList<>();
|
List<ChunkPosition> positions = new ArrayList<>();
|
||||||
|
|
||||||
tileIter:
|
|
||||||
for (TileEntity tileEntity : WorldUtils.getTileEntitiesAround(player, FindItConfig.SEARCH_RADIUS)) {
|
for (TileEntity tileEntity : WorldUtils.getTileEntitiesAround(player, FindItConfig.SEARCH_RADIUS)) {
|
||||||
try {
|
try {
|
||||||
if (!(tileEntity instanceof IInventory)) {
|
if (request.isTileSatisfies(player, tileEntity)) {
|
||||||
continue;
|
positions.add(new ChunkPosition(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord));
|
||||||
}
|
if (positions.size() == FindItConfig.MAX_RESPONSE_SIZE) {
|
||||||
IInventory inventory = (IInventory) tileEntity;
|
|
||||||
|
|
||||||
for (int slot = 0; slot < inventory.getSizeInventory(); slot++) {
|
|
||||||
ItemStack stackInSlot = inventory.getStackInSlot(slot);
|
|
||||||
if (stackInSlot == null || stackInSlot.getItem() != itemToFind) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!itemToFind.getHasSubtypes() || stackInSlot.getItemDamage() == metaToFind) {
|
|
||||||
positions.add(new ChunkPosition(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord));
|
|
||||||
if (positions.size() == FindItConfig.MAX_RESPONSE_SIZE) {
|
|
||||||
break tileIter;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -80,115 +42,7 @@ public class ItemFindService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!positions.isEmpty()) {
|
FindItNetwork.CHANNEL.sendTo(new BlockFoundResponse(positions), player);
|
||||||
ItemFoundResult foundResult = new ItemFindService.ItemFoundResult(
|
FindItNetwork.CHANNEL.sendTo(new ItemFoundResponse(request.getStackToFind()), player);
|
||||||
request.getStackToFind(), positions,
|
|
||||||
player.getEntityWorld().getTotalWorldTime()
|
|
||||||
);
|
|
||||||
|
|
||||||
lastResults.put(player, foundResult);
|
|
||||||
FindItNetwork.CHANNEL.sendTo(new ItemFoundResponse(request.getStackToFind(), positions), player);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void processOpenContainer(EntityPlayerMP player) {
|
|
||||||
lastProcessedContainers.put(player, player.openContainer.windowId);
|
|
||||||
Container container = player.openContainer;
|
|
||||||
|
|
||||||
ItemFoundResult lastFoundResult = getLastFoundResult(player);
|
|
||||||
if (lastFoundResult == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Slot> slots = (List<Slot>) container.inventorySlots;
|
|
||||||
List<Integer> targetSlots = new ArrayList<>();
|
|
||||||
Set<ChunkPosition> tilePositions = new HashSet<>();
|
|
||||||
|
|
||||||
for (int slotId = 0; slotId < slots.size(); slotId++) {
|
|
||||||
Slot slot = slots.get(slotId);
|
|
||||||
IInventory inventory = getSlotTrueInventory(slot);
|
|
||||||
if (!(inventory instanceof TileEntity)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
TileEntity tile = (TileEntity) inventory;
|
|
||||||
ChunkPosition tilePos = new ChunkPosition(tile.xCoord, tile.yCoord, tile.zCoord);
|
|
||||||
|
|
||||||
if (lastFoundResult.containsPosition(tilePos)) {
|
|
||||||
targetSlots.add(slotId);
|
|
||||||
tilePositions.add(tilePos);
|
|
||||||
|
|
||||||
if (targetSlots.size() >= 256) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!targetSlots.isEmpty()) {
|
|
||||||
tilePositions.forEach(lastFoundResult::pollPosition);
|
|
||||||
|
|
||||||
FindItNetwork.CHANNEL.sendTo(
|
|
||||||
new HighlightSlotsPacket(container.windowId, lastFoundResult.foundStack, targetSlots),
|
|
||||||
player
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private IInventory getSlotTrueInventory(Slot slot) {
|
|
||||||
if (slot.inventory instanceof InventoryLargeChest) {
|
|
||||||
InventoryLargeChest largeChest = (InventoryLargeChest) slot.inventory;
|
|
||||||
return slot.slotNumber < largeChest.upperChest.getSizeInventory() ? largeChest.upperChest : largeChest.lowerChest;
|
|
||||||
}
|
|
||||||
return slot.inventory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ContainerListener {
|
|
||||||
|
|
||||||
// called every tick to check if player can interact with container
|
|
||||||
@SubscribeEvent
|
|
||||||
public void onContainerOpen(PlayerOpenContainerEvent event) {
|
|
||||||
if (event.entityPlayer.worldObj.isRemote) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
EntityPlayerMP player = (EntityPlayerMP) event.entityPlayer;
|
|
||||||
|
|
||||||
// may not spend time to process player inventory
|
|
||||||
if (player.openContainer == player.inventoryContainer) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int lastProcessedContainer = lastProcessedContainers.getOrDefault(player, -1);
|
|
||||||
if (player.openContainer.windowId != lastProcessedContainer) {
|
|
||||||
processOpenContainer(player);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class ItemFoundResult {
|
|
||||||
private final ItemStack foundStack;
|
|
||||||
private final Set<ChunkPosition> positions = new HashSet<>();
|
|
||||||
private final long responseTime;
|
|
||||||
|
|
||||||
public ItemFoundResult(ItemStack foundStack, List<ChunkPosition> positions, long responseTime) {
|
|
||||||
this.foundStack = foundStack;
|
|
||||||
this.positions.addAll(positions);
|
|
||||||
this.responseTime = responseTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemStack getFoundStack() {
|
|
||||||
return foundStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isValid(World world) {
|
|
||||||
return !positions.isEmpty() && world.getTotalWorldTime() - responseTime < 20 * 60; // 60 sec
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean containsPosition(ChunkPosition position) {
|
|
||||||
return positions.contains(position);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void pollPosition(ChunkPosition position) {
|
|
||||||
positions.remove(position);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,59 +1,47 @@
|
|||||||
package com.gtnh.findit.service.itemfinder;
|
package com.gtnh.findit.service.itemfinder;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import com.gtnh.findit.util.ProtoUtils;
|
import com.gtnh.findit.util.ProtoUtils;
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.ChunkPosition;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class ItemFoundResponse implements IMessage {
|
public class ItemFoundResponse implements IMessage {
|
||||||
|
|
||||||
private ItemStack foundStack;
|
private ItemStack foundStack;
|
||||||
private List<ChunkPosition> positions;
|
|
||||||
|
|
||||||
public ItemFoundResponse(ItemStack foundStack, List<ChunkPosition> positions) {
|
public ItemFoundResponse(ItemStack foundStack) {
|
||||||
this.foundStack = foundStack;
|
this.foundStack = foundStack;
|
||||||
this.positions = positions;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemFoundResponse() {
|
public ItemFoundResponse() {}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void fromBytes(ByteBuf buf) {
|
public void fromBytes(ByteBuf buf) {
|
||||||
foundStack = ProtoUtils.readItemStack(buf);
|
foundStack = ProtoUtils.readItemStack(buf);
|
||||||
positions = ProtoUtils.readPositions(buf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void toBytes(ByteBuf buf) {
|
public void toBytes(ByteBuf buf) {
|
||||||
ProtoUtils.writeItemStack(buf, foundStack);
|
ProtoUtils.writeItemStack(buf, foundStack);
|
||||||
ProtoUtils.writePositions(buf, positions);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getFoundStack() {
|
public ItemStack getFoundStack() {
|
||||||
return foundStack;
|
return foundStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ChunkPosition> getPositions() {
|
|
||||||
return positions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Handler implements IMessageHandler<ItemFoundResponse, IMessage> {
|
public static class Handler implements IMessageHandler<ItemFoundResponse, IMessage> {
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
public IMessage onMessage(ItemFoundResponse message, MessageContext ctx) {
|
public IMessage onMessage(ItemFoundResponse message, MessageContext ctx) {
|
||||||
if (message.foundStack != null && !message.positions.isEmpty()) {
|
ClientItemFindService.getInstance().handleResponse(Minecraft.getMinecraft().thePlayer, message);
|
||||||
ClientItemFindService.getInstance().handleResponse(Minecraft.getMinecraft().thePlayer, message);
|
|
||||||
}
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
package com.gtnh.findit.util;
|
package com.gtnh.findit.util;
|
||||||
|
|
||||||
import codechicken.nei.LayoutManager;
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import codechicken.nei.NEIClientConfig;
|
import codechicken.nei.NEIClientConfig;
|
||||||
import codechicken.nei.guihook.GuiContainerManager;
|
import codechicken.nei.guihook.GuiContainerManager;
|
||||||
import codechicken.nei.guihook.IContainerInputHandler;
|
import codechicken.nei.guihook.IContainerInputHandler;
|
||||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
|
|
||||||
public abstract class AbstractStackFinder implements IContainerInputHandler {
|
public abstract class AbstractStackFinder implements IContainerInputHandler {
|
||||||
|
|
||||||
@@ -15,47 +15,36 @@ public abstract class AbstractStackFinder implements IContainerInputHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean keyTyped(GuiContainer window, char c, int key) {
|
public boolean keyTyped(GuiContainer window, char c, int key) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onKeyTyped(GuiContainer guiContainer, char c, int i) {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean lastKeyTyped(GuiContainer guiContainer, char c, int i) {
|
||||||
if (!NEIClientConfig.isKeyHashDown(getKeyBindId())) {
|
if (!NEIClientConfig.isKeyHashDown(getKeyBindId())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LayoutManager layout = LayoutManager.instance();
|
ItemStack stack = GuiContainerManager.getStackMouseOver(guiContainer);
|
||||||
if (layout == null || LayoutManager.itemPanel == null || NEIClientConfig.isHidden()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
ItemStack stack = GuiContainerManager.getStackMouseOver(window);
|
|
||||||
if (stack == null || stack.getItem() == null) {
|
if (stack == null || stack.getItem() == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return findStack(stack);
|
return findStack(stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onKeyTyped(GuiContainer guiContainer, char c, int i) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean lastKeyTyped(GuiContainer guiContainer, char c, int i) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean mouseClicked(GuiContainer guiContainer, int i, int i1, int i2) {
|
public boolean mouseClicked(GuiContainer guiContainer, int i, int i1, int i2) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMouseClicked(GuiContainer guiContainer, int i, int i1, int i2) {
|
public void onMouseClicked(GuiContainer guiContainer, int i, int i1, int i2) {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMouseUp(GuiContainer guiContainer, int i, int i1, int i2) {
|
public void onMouseUp(GuiContainer guiContainer, int i, int i1, int i2) {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean mouseScrolled(GuiContainer guiContainer, int i, int i1, int i2) {
|
public boolean mouseScrolled(GuiContainer guiContainer, int i, int i1, int i2) {
|
||||||
@@ -63,12 +52,8 @@ public abstract class AbstractStackFinder implements IContainerInputHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMouseScrolled(GuiContainer guiContainer, int i, int i1, int i2) {
|
public void onMouseScrolled(GuiContainer guiContainer, int i, int i1, int i2) {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMouseDragged(GuiContainer guiContainer, int i, int i1, int i2, long l) {
|
public void onMouseDragged(GuiContainer guiContainer, int i, int i1, int i2, long l) {}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package com.gtnh.findit.util;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
|
import net.minecraft.util.Vec3;
|
||||||
|
import net.minecraft.world.ChunkPosition;
|
||||||
|
|
||||||
|
import com.gtnh.findit.service.blockfinder.BlockFoundResponse;
|
||||||
|
|
||||||
|
public class ClientFinderHelperUtils {
|
||||||
|
|
||||||
|
public static void lookAtTarget(EntityClientPlayerMP player, BlockFoundResponse response) {
|
||||||
|
rotateViewHelper(player, response.getPositions());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void rotateViewHelper(EntityClientPlayerMP player, List<ChunkPosition> targets) {
|
||||||
|
if (targets.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Vec3 eyesPos = player.getPosition(1.0F);
|
||||||
|
Vec3 nearestPos = center(getNearBlock(eyesPos, targets));
|
||||||
|
|
||||||
|
Rotation targetRotation = Rotation.lookAt(eyesPos, nearestPos);
|
||||||
|
targetRotation.apply(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Vec3 center(ChunkPosition p) {
|
||||||
|
return Vec3.createVectorHelper(p.chunkPosX + 0.5, p.chunkPosY + 0.5, p.chunkPosZ + 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ChunkPosition getNearBlock(Vec3 player, List<ChunkPosition> targets) {
|
||||||
|
ChunkPosition result = null;
|
||||||
|
double minDistance = Double.MAX_VALUE;
|
||||||
|
|
||||||
|
for (ChunkPosition target : targets) {
|
||||||
|
double distance = getDistanceToCenter(player, target);
|
||||||
|
if (distance < minDistance) {
|
||||||
|
result = target;
|
||||||
|
minDistance = distance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static double getDistanceToCenter(Vec3 player, ChunkPosition target) {
|
||||||
|
double deltaX = target.chunkPosX + 0.5 - player.xCoord;
|
||||||
|
double deltaY = target.chunkPosY + 0.5 - player.yCoord;
|
||||||
|
double deltaZ = target.chunkPosZ + 0.5 - player.zCoord;
|
||||||
|
|
||||||
|
return Math.sqrt(deltaX * deltaX + deltaZ * deltaZ + deltaY * deltaY);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static AxisAlignedBB mergeAABB(AxisAlignedBB box1, AxisAlignedBB box2) {
|
||||||
|
return AxisAlignedBB.getBoundingBox(
|
||||||
|
Math.min(box1.minX, box2.minX),
|
||||||
|
Math.min(box1.minY, box2.minY),
|
||||||
|
Math.min(box1.minZ, box2.minZ),
|
||||||
|
Math.max(box1.maxX, box2.maxX),
|
||||||
|
Math.max(box1.maxY, box2.maxY),
|
||||||
|
Math.max(box1.maxZ, box2.maxZ));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,21 +1,22 @@
|
|||||||
package com.gtnh.findit.util;
|
package com.gtnh.findit.util;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.network.PacketBuffer;
|
|
||||||
import net.minecraft.world.ChunkPosition;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.network.PacketBuffer;
|
||||||
|
import net.minecraft.world.ChunkPosition;
|
||||||
|
|
||||||
|
import io.netty.buffer.ByteBuf;
|
||||||
|
|
||||||
public class ProtoUtils {
|
public class ProtoUtils {
|
||||||
|
|
||||||
public static void writePositions(ByteBuf buf, List<ChunkPosition> positions) {
|
public static void writePositions(ByteBuf buf, List<ChunkPosition> positions) {
|
||||||
buf.writeInt(positions.size());
|
buf.writeInt(positions.size());
|
||||||
for (ChunkPosition pos : positions) {
|
for (ChunkPosition pos : positions) {
|
||||||
buf.writeInt(pos.chunkPosX);
|
buf.writeInt(pos.chunkPosX);
|
||||||
buf.writeByte(pos.chunkPosY);
|
buf.writeInt(pos.chunkPosY);
|
||||||
buf.writeInt(pos.chunkPosZ);
|
buf.writeInt(pos.chunkPosZ);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -34,7 +35,7 @@ public class ProtoUtils {
|
|||||||
List<ChunkPosition> positions = new ArrayList<>();
|
List<ChunkPosition> positions = new ArrayList<>();
|
||||||
while (amount > 0) {
|
while (amount > 0) {
|
||||||
final int x = buf.readInt();
|
final int x = buf.readInt();
|
||||||
final int y = buf.readUnsignedByte();
|
final int y = buf.readInt();
|
||||||
final int z = buf.readInt();
|
final int z = buf.readInt();
|
||||||
positions.add(new ChunkPosition(x, y, z));
|
positions.add(new ChunkPosition(x, y, z));
|
||||||
--amount;
|
--amount;
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.gtnh.findit.util;
|
||||||
|
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.util.Vec3;
|
||||||
|
|
||||||
|
public class Rotation {
|
||||||
|
|
||||||
|
private final float yaw;
|
||||||
|
private final float pitch;
|
||||||
|
|
||||||
|
public Rotation(float yaw, float pitch) {
|
||||||
|
this.yaw = yaw;
|
||||||
|
this.pitch = pitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float yaw() {
|
||||||
|
return yaw;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float pitch() {
|
||||||
|
return pitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void apply(Entity entity) {
|
||||||
|
entity.rotationYaw = yaw;
|
||||||
|
entity.rotationPitch = pitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Rotation lookAt(Vec3 source, Vec3 target) {
|
||||||
|
double deltaX = target.xCoord - source.xCoord;
|
||||||
|
double deltaY = target.yCoord - source.yCoord;
|
||||||
|
double deltaZ = target.zCoord - source.zCoord;
|
||||||
|
|
||||||
|
double distanceXZ = Math.sqrt(deltaX * deltaX + deltaZ * deltaZ);
|
||||||
|
|
||||||
|
float yaw = (float) Math.toDegrees(Math.atan2(-deltaX, deltaZ));
|
||||||
|
float pitch = (float) Math.toDegrees(Math.atan2(-deltaY, distanceXZ));
|
||||||
|
|
||||||
|
return new Rotation(yaw, pitch);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
package com.gtnh.findit.util;
|
package com.gtnh.findit.util;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.ChunkPosition;
|
import net.minecraft.world.ChunkPosition;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.Chunk;
|
import net.minecraft.world.chunk.Chunk;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class WorldUtils {
|
public class WorldUtils {
|
||||||
|
|
||||||
public static List<TileEntity> getTileEntitiesAround(Entity entity, int r) {
|
public static List<TileEntity> getTileEntitiesAround(Entity entity, int r) {
|
||||||
@@ -23,7 +23,8 @@ public class WorldUtils {
|
|||||||
* @param (x1,y1,z1) included
|
* @param (x1,y1,z1) included
|
||||||
* @param (x2,y2,z2) excluded
|
* @param (x2,y2,z2) excluded
|
||||||
*/
|
*/
|
||||||
public static List<TileEntity> getTileEntitiesInRegion(World world, int x1, int y1, int z1, int x2, int y2, int z2) {
|
public static List<TileEntity> getTileEntitiesInRegion(World world, int x1, int y1, int z1, int x2, int y2,
|
||||||
|
int z2) {
|
||||||
List<TileEntity> result = new ArrayList<>();
|
List<TileEntity> result = new ArrayList<>();
|
||||||
int cx1 = x2 >> 4;
|
int cx1 = x2 >> 4;
|
||||||
int cz1 = z2 >> 4;
|
int cz1 = z2 >> 4;
|
||||||
@@ -32,12 +33,15 @@ public class WorldUtils {
|
|||||||
for (int cz = z1 >> 4; cz <= cz1; cz++) {
|
for (int cz = z1 >> 4; cz <= cz1; cz++) {
|
||||||
Chunk chunk = world.getChunkFromChunkCoords(cx, cz);
|
Chunk chunk = world.getChunkFromChunkCoords(cx, cz);
|
||||||
if (chunk != null) {
|
if (chunk != null) {
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
Map<ChunkPosition, TileEntity> tiles = chunk.chunkTileEntityMap;
|
Map<ChunkPosition, TileEntity> tiles = chunk.chunkTileEntityMap;
|
||||||
for (TileEntity tile : tiles.values()) {
|
for (TileEntity tile : tiles.values()) {
|
||||||
if (!tile.isInvalid()
|
if (!tile.isInvalid() && tile.xCoord >= x1
|
||||||
&& tile.xCoord >= x1 && tile.xCoord < x2
|
&& tile.xCoord < x2
|
||||||
&& tile.yCoord >= y1 && tile.yCoord < y2
|
&& tile.yCoord >= y1
|
||||||
&& tile.zCoord >= z1 && tile.zCoord < z2) {
|
&& tile.yCoord < y2
|
||||||
|
&& tile.zCoord >= z1
|
||||||
|
&& tile.zCoord < z2) {
|
||||||
result.add(tile);
|
result.add(tile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 274 B After Width: | Height: | Size: 227 B |
@@ -1,6 +1,7 @@
|
|||||||
[
|
{
|
||||||
{
|
"modListVersion": 2,
|
||||||
"modid": "findit",
|
"modList": [{
|
||||||
|
"modid": "${modId}",
|
||||||
"name": "${modName}",
|
"name": "${modName}",
|
||||||
"description": "Now where did I put that EV mixer...",
|
"description": "Now where did I put that EV mixer...",
|
||||||
"version": "${modVersion}",
|
"version": "${modVersion}",
|
||||||
@@ -11,6 +12,6 @@
|
|||||||
"credits": "Heavily inspired from Buuz135/findme",
|
"credits": "Heavily inspired from Buuz135/findme",
|
||||||
"logoFile": "",
|
"logoFile": "",
|
||||||
"screenshots": [],
|
"screenshots": [],
|
||||||
"dependencies": ["NotEnoughItems"]
|
"parent": ""
|
||||||
}
|
}]
|
||||||
]
|
}
|
||||||
Reference in new issue
Block a user