mirror of
https://github.com/GTNewHorizons/FindIt.git
synced 2026-11-27 03:32:55 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b537a26003 |
No files matched your search
@@ -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,6 +2,7 @@
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("com.github.GTNewHorizons:NotEnoughItems:2.8.75-GTNH:dev")
|
implementation("com.github.GTNewHorizons:NotEnoughItems:2.8.75-GTNH:dev")
|
||||||
|
implementation("com.github.GTNewHorizons:GTNHLib:0.9.42:dev")
|
||||||
|
|
||||||
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.52.348:dev")
|
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.52.348:dev")
|
||||||
compileOnly("com.github.GTNewHorizons:EnderIO:2.10.21:dev")
|
compileOnly("com.github.GTNewHorizons:EnderIO:2.10.21:dev")
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ 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;
|
||||||
@@ -55,8 +57,11 @@ public class FindIt {
|
|||||||
this.isGregTechLoaded = Loader.isModLoaded("gregtech") && !Loader.isModLoaded("gregapi");
|
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();
|
||||||
|
|||||||
@@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user