Compare commits

..
20 Commits
Author SHA1 Message Date
UltraProdigy 296f29ae76 ci: run build and test on release branches 2026-11-09 02:01:02 -05:00
Armisael5 84dd2e45f9 Fix some TEs not being Y-searchable (#39) 2026-10-27 08:24:38 +08:00
Esania 3b6d5fa3ad Fix incorrect block highlights with Cubic Chunks (#38) 2026-09-25 23:25:34 -04:00
John Rowley f2b4c1a262 feat: add covers to T search (#31) 2026-08-16 21:00:04 +07:00
John Rowley 199f1d81e1 feat: add ability to T search for contents of inventory covers (#32) 2026-08-16 19:18:05 +07:00
UltraProdigy c764b60a83 Fix Build (#37) 2026-08-15 11:06:26 +07:00
Dream Master c793ceec36 update+gradle+bs+deps 2026-08-10 23:51:25 +07:00
Caedis fd292e5649 fix: use renderViewEntity for camera math (#36) 2026-08-10 11:49:21 -04:00
Algent 5c78cd6e54 Fix GL leaks (#35) 2026-07-27 12:34:09 +07:00
Martin Robertz b03be8e3a7 update 2026-04-27 13:37:22 +02:00
UltraProdigy f925a189b0 Optimize Images & Workflow (#30) 2026-04-26 08:39:55 +02:00
koolkrafter5andNikolay S. b537a26003 Migrate to GTNHLib config system (#29)
Co-authored-by: Nikolay S. <[email protected]>
2026-03-15 22:51:30 +01:00
Martin Robertz 82c33ae3c7 update 2026-03-11 21:40:25 +01:00
koolkrafter5 f34980692b Add support for Aspect Recipe Index and remove requirement of TCNEIPlugin to load ThaumcraftProvider (#28) 2026-03-11 19:11:11 +01:00
Maya ab6c722369 update 2025-05-13 18:56:42 -05:00
__felix__ b0c4b81d5f fix loader check (#27) 2025-05-13 18:56:03 -05:00
Martin Robertz b3c002b42b update 2024-11-23 16:56:49 +01:00
Wilhelm Schuster d78625b514 Fix essentia search NPE (#26) 2024-11-19 19:08:17 +01:00
Martin Robertz 511b388b83 update 2024-10-27 14:41:16 +01:00
Temm 9278283ae8 fix thaumcraft search crash (#25) 2024-10-25 23:50:07 +02:00
24 changed files with 352 additions and 154 deletions

No files matched your search

+2 -2
View File
@@ -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:
+17
View File
@@ -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
+17 -3
View File
@@ -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.
+17 -13
View File
@@ -1,23 +1,27 @@
// Add your dependencies here // Add your dependencies here
dependencies { dependencies {
implementation('com.github.GTNewHorizons:NotEnoughItems:2.6.42-GTNH:dev') implementation("com.github.GTNewHorizons:NotEnoughItems:2.8.121-GTNH:dev")
implementation("com.github.GTNewHorizons:GTNHLib:0.11.37:dev")
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.50.49:dev') compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.54.80:dev")
compileOnly('com.github.GTNewHorizons:EnderIO:2.8.19:dev') compileOnly("com.github.GTNewHorizons:EnderIO:2.10.36:dev")
compileOnly('com.github.GTNewHorizons:Draconic-Evolution:1.3.11.GTNH:dev') compileOnly("com.github.GTNewHorizons:Draconic-Evolution:1.5.31-GTNH:dev")
compileOnly('com.github.GTNewHorizons:ForestryMC:4.9.16:dev') compileOnly("com.github.GTNewHorizons:ForestryMC:4.11.34:dev")
compileOnly('com.github.GTNewHorizons:AdventureBackpack2:1.2.3-GTNH:dev') compileOnly("com.github.GTNewHorizons:AdventureBackpack2:1.4.23-GTNH:dev")
compileOnly("com.github.GTNewHorizons:ProjectRed:4.10.5-GTNH:dev") compileOnly("com.github.GTNewHorizons:ProjectRed:4.12.41-GTNH:dev")
compileOnly("com.github.GTNewHorizons:Minecraft-Backpack-Mod:2.4.3-GTNH:dev") compileOnly("com.github.GTNewHorizons:Minecraft-Backpack-Mod:2.6.16-GTNH:dev")
compileOnly("curse.maven:thaumcraft-nei-plugin-225095:2241913") compileOnly("curse.maven:thaumcraft-nei-plugin-225095:2241913")
compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") 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. // For testing in dev environment.
// runtimeOnlyNonPublishable('com.github.GTNewHorizons:StorageDrawers:2.0.3-GTNH') // runtimeOnlyNonPublishable("com.github.GTNewHorizons:StorageDrawers:2.2.28-GTNH")
// runtimeOnlyNonPublishable("com.github.GTNewHorizons:waila:1.8.1") // runtimeOnlyNonPublishable("com.github.GTNewHorizons:waila:1.19.31")
// runtimeOnlyNonPublishable('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev') // runtimeOnlyNonPublishable("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev")
// runtimeOnlyNonPublishable("com.github.GTNewHorizons:Baubles:1.0.4:dev") // runtimeOnlyNonPublishable("com.github.GTNewHorizons:Baubles-Expanded:2.2.22-GTNH:dev")
// runtimeOnlyNonPublishable('curse.maven:thaumcraft-nei-plugin-225095:2241913') // runtimeOnlyNonPublishable(rfg.deobf("curse.maven:thaumcraft-nei-plugin-225095:2241913"))
// runtimeOnlyNonPublishable("com.github.GTNewHorizons:AspectRecipeIndex:1.1.3:dev")
} }
+41 -6
View File
@@ -14,7 +14,7 @@ modId = findit
modGroup = com.gtnh.findit modGroup = com.gtnh.findit
# Whether to use modGroup as the maven publishing group. # Whether to use modGroup as the maven publishing group.
# Due to a history of using JitPack, the default is com.github.GTNewHorizons for all mods. # When false, com.github.GTNewHorizons is used.
useModGroupForPublishing = false useModGroupForPublishing = false
# Updates your build.gradle and settings.gradle automatically whenever an update is available. # Updates your build.gradle and settings.gradle automatically whenever an update is available.
@@ -39,9 +39,33 @@ remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/co
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE. # `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
developmentEnvironmentUserName = Developer developmentEnvironmentUserName = Developer
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8. # Enables modern Java syntax support. Valid values:
# See https://github.com/bsideup/jabel for details on how this works. # - false: No modern syntax, Java 8 only
enableModernJavaSyntax = true # - 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. # 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. # Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
@@ -96,7 +120,9 @@ 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!
@@ -151,7 +177,7 @@ modrinthProjectId =
# type can be one of [project, version], # type can be one of [project, version],
# and the name is the Modrinth project or version slug/id of the other mod. # 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 # Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true # Note: UniMixins is automatically set as a required dependency if usesMixins = true.
modrinthRelations = modrinthRelations =
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens. # Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
@@ -172,6 +198,12 @@ curseForgeRelations =
# projects. New projects should not use this parameter. # projects. New projects should not use this parameter.
# customArchiveBaseName = # 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. # 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'. # 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. # The check is ONLY performed if the version is a git tag.
@@ -201,3 +233,6 @@ curseForgeRelations =
# This is meant to be set in $HOME/.gradle/gradle.properties. # This is meant to be set in $HOME/.gradle/gradle.properties.
# ideaCheckSpotlessOnBuild = true # ideaCheckSpotlessOnBuild = true
# Non-GTNH properties
org.gradle.configuration-cache = true
org.gradle.parallel = true
+12
View File
@@ -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
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
Vendored
+5 -9
View File
@@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# #
# Copyright © 2015-2021 the original 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.
@@ -57,7 +57,7 @@
# Darwin, MinGW, and NonStop. # Darwin, MinGW, and NonStop.
# #
# (3) This script is generated from the Groovy template # (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # 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. # within the Gradle project.
# #
# You can find Gradle at https://github.com/gradle/gradle/. # You can find Gradle at https://github.com/gradle/gradle/.
@@ -86,8 +86,7 @@ done
# shellcheck disable=SC2034 # shellcheck disable=SC2034
APP_BASE_NAME=${0##*/} APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
' "$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
@@ -115,7 +114,6 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=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.
@@ -173,7 +171,6 @@ fi
# For Cygwin or MSYS, switch paths to Windows format before running java # For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" ) JAVACMD=$( cygpath --unix "$JAVACMD" )
@@ -206,15 +203,14 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command: # Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, # * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped. # 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 # * 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. # treated as '${Hostname}' itself on the command line.
set -- \ set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \ "-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
org.gradle.wrapper.GradleWrapperMain \
"$@" "$@"
# Stop when "xargs" is not available. # Stop when "xargs" is not available.
Vendored
+1 -2
View File
@@ -70,11 +70,10 @@ goto fail
: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 %* "%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
+1 -1
View File
@@ -17,7 +17,7 @@ pluginManagement {
} }
plugins { plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.27' id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.29'
} }
+16 -4
View File
@@ -3,11 +3,15 @@ package com.gtnh.findit;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; 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.IStackFilter.IStackFilterProvider;
import com.gtnh.findit.handler.AdventureBackpackProvider; import com.gtnh.findit.handler.AdventureBackpackProvider;
import com.gtnh.findit.handler.BackpackProvider; import com.gtnh.findit.handler.BackpackProvider;
import com.gtnh.findit.handler.DraconicEvolutionProvider; import com.gtnh.findit.handler.DraconicEvolutionProvider;
import com.gtnh.findit.handler.ForestryStackFilterProvider; 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.MinecraftProvider;
import com.gtnh.findit.handler.ProjectRedExplorationProvider; import com.gtnh.findit.handler.ProjectRedExplorationProvider;
import com.gtnh.findit.handler.ThaumcraftProvider; import com.gtnh.findit.handler.ThaumcraftProvider;
@@ -52,11 +56,14 @@ public class FindIt {
@Mod.EventHandler @Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) { public void preInit(FMLPreInitializationEvent event) {
this.isExtraUtilitiesLoaded = Loader.isModLoaded("ExtraUtilities"); this.isExtraUtilitiesLoaded = Loader.isModLoaded("ExtraUtilities");
this.isGregTechLoaded = Loader.isModLoaded("gregtech"); this.isGregTechLoaded = Loader.isModLoaded("gregtech") && !Loader.isModLoaded("gregapi");
this.isEnderIOLoaded = Loader.isModLoaded("EnderIO"); this.isEnderIOLoaded = Loader.isModLoaded("EnderIO");
this.cooldownService = new SearchCooldownService(); this.cooldownService = new SearchCooldownService();
try {
FindItConfig.setup(event.getSuggestedConfigurationFile()); ConfigurationManager.registerConfig(FindItConfig.class);
} catch (ConfigException e) {
throw new RuntimeException(e);
}
if (event.getSide() == Side.CLIENT) { if (event.getSide() == Side.CLIENT) {
this.blockFindService = new ClientBlockFindService(); this.blockFindService = new ClientBlockFindService();
@@ -86,10 +93,15 @@ public class FindIt {
this.pluginsList.add(new BackpackProvider()); this.pluginsList.add(new BackpackProvider());
} }
if (Loader.isModLoaded("thaumcraftneiplugin") && Loader.isModLoaded("Thaumcraft")) { if (Loader.isModLoaded("Thaumcraft")) {
this.pluginsList.add(new ThaumcraftProvider()); this.pluginsList.add(new ThaumcraftProvider());
} }
if (this.isGregTechLoaded) {
this.pluginsList.add(new GregTechCoverProvider());
this.pluginsList.add(new GregTechCoverChestProvider());
}
this.pluginsList.add(new MinecraftProvider()); this.pluginsList.add(new MinecraftProvider());
} }
+56 -81
View File
@@ -1,98 +1,73 @@
package com.gtnh.findit; package com.gtnh.findit;
import java.io.File; import com.gtnewhorizon.gtnhlib.config.Config;
import net.minecraftforge.common.config.Configuration;
@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)
public static boolean ENABLE_ROTATE_VIEW = false; @Config.Name("SearchRadius")
public static boolean USE_PARTICLE_HIGHLIGHTER = false; public static int SEARCH_RADIUS;
public static boolean SEARCH_ITEMS_ON_GROUND = true;
public static boolean SEARCH_IN_GT_PIPES = false;
public static boolean SEARCH_IN_ENDERIO_CONDUITS = false;
public static int ITEM_HIGHLIGHTING_DURATION = 10;
public static int BLOCK_HIGHLIGHTING_DURATION = 8;
public static int ITEM_HIGHLIGHTING_COLOR = 0xFFFF8726;
public static boolean ITEM_HIGHLIGHTING_EMPTY_ITEMSTACKS = true;
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(Configuration.CATEGORY_GENERAL, "SearchRadius", "16", "Radius to search within") @Config.Comment("Maximum number of positions that can be displayed by item/block search")
.getInt(); @Config.DefaultInt(20)
@Config.RangeInt(min = 0)
@Config.Name("MaxResponseSize")
public static int MAX_RESPONSE_SIZE;
SEARCH_COOLDOWN = config @Config.Comment("Rotate the player's view to face found items/blocks after searching")
.get(Configuration.CATEGORY_GENERAL, "SearchCooldown", "10", "Search cooldown in ticks").getInt(); @Config.DefaultBoolean(false)
@Config.Name("EnableRotateView")
public static boolean ENABLE_ROTATE_VIEW;
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();
USE_PARTICLE_HIGHLIGHTER = config.get( @Config.Comment("Search items dropped on the ground")
Configuration.CATEGORY_GENERAL, @Config.DefaultBoolean(true)
"UseParticleHighlighter", @Config.Name("SearchItemsOnGround")
"false", public static boolean SEARCH_ITEMS_ON_GROUND;
"Use Particle for Block Highlighter").getBoolean();
SEARCH_IN_GT_PIPES = config.get( @Config.Comment("Search items and fluids in GT pipes")
Configuration.CATEGORY_GENERAL, @Config.DefaultBoolean(false)
"SearchInGregTechPipes", @Config.Name("SearchInGregTechPipes")
"false", public static boolean SEARCH_IN_GT_PIPES;
"Search items & fluids in GT pipes").getBoolean();
SEARCH_IN_ENDERIO_CONDUITS = config.get( @Config.Comment("Search items and fluids in EnderIO conduits")
Configuration.CATEGORY_GENERAL, @Config.DefaultBoolean(false)
"SearchInEnderIOConduits", @Config.Name("SearchInEnderIOConduits")
"false", public static boolean SEARCH_IN_ENDERIO_CONDUITS;
"Search items & fluids in EnderIO conduits").getBoolean();
SEARCH_ITEMS_ON_GROUND = config.get( @Config.Comment("Item highlighting duration in seconds")
Configuration.CATEGORY_GENERAL, @Config.DefaultInt(10)
"SearchItemsOnGround", @Config.RangeInt(min = 1)
"true", @Config.Name("ItemHighlightingDuration")
"Search items dropped on ground").getBoolean(); public static int ITEM_HIGHLIGHTING_DURATION;
ITEM_HIGHLIGHTING_DURATION = config @Config.Comment("Block highlighting duration in seconds")
.get(Configuration.CATEGORY_GENERAL, "ItemHighlightingDuration", "10", "Item highlighting duration") @Config.DefaultInt(8)
.getInt(); @Config.RangeInt(min = 1)
@Config.Name("BlockHighlightingDuration")
public static int BLOCK_HIGHLIGHTING_DURATION;
BLOCK_HIGHLIGHTING_DURATION = config.get( @Config.Comment("Item highlighting color as an ARGB hexadecimal color code.\nDo not prefix with \"0x\"")
Configuration.CATEGORY_GENERAL, @Config.DefaultString("FFFF8726")
"BlockHighlightingDuration", @Config.Name("ItemHighlightingColor")
"8", public static String ITEM_HIGHLIGHTING_COLOR;
"Block highlighting duration in seconds").getInt();
ENABLE_ROTATE_VIEW = config.get( @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"
Configuration.CATEGORY_GENERAL, + "This is useful when working with barrels or storage drawers.")
"EnableRotateView", @Config.DefaultBoolean(true)
"false", @Config.Name("ItemHighlightingEmptyItemStacks")
"Rotate player's view when searched").getBoolean(); public static boolean ITEM_HIGHLIGHTING_EMPTY_ITEMSTACKS;
ITEM_HIGHLIGHTING_COLOR = Integer.parseUnsignedInt(
config.get(
Configuration.CATEGORY_GENERAL,
"ItemHighlightingColor",
"FFFF8726",
"Item highlighting color as a hexadecimal color code. For example 0xFFFF8726").getString(),
16);
ITEM_HIGHLIGHTING_EMPTY_ITEMSTACKS = config.get(
Configuration.CATEGORY_GENERAL,
"ItemHighlightingEmptyItemStacks",
"true",
"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.")
.getBoolean();
} catch (Exception ignore) {} finally {
if (config.hasChanged()) config.save();
}
}
} }
@@ -6,8 +6,8 @@ import java.util.List;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockChest; import net.minecraft.block.BlockChest;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.multiplayer.WorldClient; import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityChest; import net.minecraft.tileentity.TileEntityChest;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
@@ -44,7 +44,7 @@ public class BlockHighlighter {
positions.clear(); positions.clear();
} }
EntityPlayerSP p = mc.thePlayer; EntityLivingBase p = mc.renderViewEntity != null ? mc.renderViewEntity : mc.thePlayer;
double doubleX = p.lastTickPosX + (p.posX - p.lastTickPosX) * event.partialTicks; double doubleX = p.lastTickPosX + (p.posX - p.lastTickPosX) * event.partialTicks;
double doubleY = p.lastTickPosY + (p.posY - p.lastTickPosY) * event.partialTicks; double doubleY = p.lastTickPosY + (p.posY - p.lastTickPosY) * event.partialTicks;
double doubleZ = p.lastTickPosZ + (p.posZ - p.lastTickPosZ) * event.partialTicks; double doubleZ = p.lastTickPosZ + (p.posZ - p.lastTickPosZ) * event.partialTicks;
@@ -4,9 +4,9 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraftforge.client.event.RenderWorldLastEvent; import net.minecraftforge.client.event.RenderWorldLastEvent;
@@ -40,7 +40,7 @@ public class EntityHighlighter {
entityIds.clear(); entityIds.clear();
} }
EntityPlayerSP p = mc.thePlayer; EntityLivingBase p = mc.renderViewEntity != null ? mc.renderViewEntity : mc.thePlayer;
double doubleX = p.lastTickPosX + (p.posX - p.lastTickPosX) * event.partialTicks; double doubleX = p.lastTickPosX + (p.posX - p.lastTickPosX) * event.partialTicks;
double doubleY = p.lastTickPosY + (p.posY - p.lastTickPosY) * event.partialTicks; double doubleY = p.lastTickPosY + (p.posY - p.lastTickPosY) * event.partialTicks;
double doubleZ = p.lastTickPosZ + (p.posZ - p.lastTickPosZ) * event.partialTicks; double doubleZ = p.lastTickPosZ + (p.posZ - p.lastTickPosZ) * event.partialTicks;
@@ -49,13 +49,14 @@ public class ParticlePosition extends EntityReddustFX {
float rotationYZ, float rotationXY, float rotationXZ) { 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();
} }
@@ -54,7 +54,11 @@ public class SlotHighlighter implements IContainerDrawHandler {
@Override @Override
public void renderSlotUnderlay(GuiContainer gui, Slot slot) { public void renderSlotUnderlay(GuiContainer gui, Slot slot) {
if (this.gui == gui && this.slots.contains(slot)) { if (this.gui == gui && this.slots.contains(slot)) {
GL11.glPushMatrix(); 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_LIGHTING);
GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glDisable(GL11.GL_ALPHA_TEST);
@@ -71,12 +75,7 @@ public class SlotHighlighter implements IContainerDrawHandler {
highlightSlot(tessellator, slot.xDisplayPosition, slot.yDisplayPosition); highlightSlot(tessellator, slot.xDisplayPosition, slot.yDisplayPosition);
tessellator.draw(); tessellator.draw();
GL11.glShadeModel(GL11.GL_FLAT); GL11.glPopAttrib();
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
} }
} }
@@ -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;
}
}
@@ -5,11 +5,12 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import com.djgiannuzz.thaumcraftneiplugin.items.ItemAspect; import com.gtnewhorizons.aspectrecipeindex.common.items.ItemAspect;
import com.gtnh.findit.IStackFilter; import com.gtnh.findit.IStackFilter;
import com.gtnh.findit.IStackFilter.IStackFilterProvider; import com.gtnh.findit.IStackFilter.IStackFilterProvider;
import com.gtnh.findit.service.itemfinder.FindItemRequest; import com.gtnh.findit.service.itemfinder.FindItemRequest;
import cpw.mods.fml.common.Loader;
import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.aspects.IAspectContainer; import thaumcraft.api.aspects.IAspectContainer;
@@ -17,6 +18,9 @@ import thaumcraft.api.aspects.IEssentiaContainerItem;
public class ThaumcraftProvider implements IStackFilterProvider { 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 { static class AspectStackFilter implements IStackFilter {
AspectList filterAspects; AspectList filterAspects;
@@ -29,26 +33,42 @@ public class ThaumcraftProvider implements IStackFilterProvider {
public boolean matches(FindItemRequest request) { public boolean matches(FindItemRequest request) {
ItemStack stack = request.getStackToFind(); ItemStack stack = request.getStackToFind();
Item item = stack.getItem(); Item item = stack.getItem();
if (!(item instanceof ItemAspect || item instanceof IEssentiaContainerItem)) return false; 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;
}
AspectList stackAspects = ItemAspect.getAspects(stack); return filterAspects.getAmount(aspect) > 0;
if (stackAspects.size() != 1) return false;
Aspect stackAspect = stackAspects.getAspects()[0];
return filterAspects.getAmount(stackAspect) > 0;
} }
} }
@Override @Override
public IStackFilter getFilter(EntityPlayer player, TileEntity tileEntity) { public IStackFilter getFilter(EntityPlayer player, TileEntity tileEntity) {
if (!(tileEntity instanceof IAspectContainer aspectContainer)) return null; if (!(tileEntity instanceof IAspectContainer aspectContainer)) return null;
return new AspectStackFilter(aspectContainer.getAspects()); AspectList aspects = aspectContainer.getAspects();
if (aspects == null) return null;
return new AspectStackFilter(aspects);
} }
@Override @Override
public IStackFilter getFilter(EntityPlayer player, ItemStack stack) { public IStackFilter getFilter(EntityPlayer player, ItemStack stack) {
if (!(stack.getItem() instanceof IEssentiaContainerItem containerItem)) return null; if (!(stack.getItem() instanceof IEssentiaContainerItem containerItem)) return null;
return new AspectStackFilter(containerItem.getAspects(stack)); AspectList aspects = containerItem.getAspects(stack);
if (aspects == null) return null;
return new AspectStackFilter(aspects);
} }
} }
@@ -14,7 +14,6 @@ import com.gtnh.findit.FindItNetwork;
import com.gtnh.findit.util.WorldUtils; import com.gtnh.findit.util.WorldUtils;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
public class BlockFindService { public class BlockFindService {
@@ -37,12 +36,11 @@ public class BlockFindService {
continue; continue;
} }
int tileMeta; int tileMeta = tileBlock.getDamageValue(
if (FindIt.isGregTechLoaded() && tileEntity instanceof IGregTechTileEntity gregTech) { tileEntity.getWorldObj(),
tileMeta = gregTech.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));
@@ -138,7 +138,15 @@ public class ClientItemFindService extends ItemFindService {
} }
} }
slotHighlighter.highlightSlots(gui, highlightedSlots, FindItConfig.ITEM_HIGHLIGHTING_COLOR); slotHighlighter.highlightSlots(gui, highlightedSlots, getItemHighlightingColor());
}
}
private static int getItemHighlightingColor() {
try {
return Integer.parseUnsignedInt(FindItConfig.ITEM_HIGHLIGHTING_COLOR, 16);
} catch (NumberFormatException e) {
return 0xFFFF8726;
} }
} }
@@ -16,7 +16,7 @@ public class ProtoUtils {
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);
} }
} }
@@ -35,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;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 274 B

After

Width:  |  Height:  |  Size: 227 B