Compare commits

..
4 Commits
Author SHA1 Message Date
Martin Robertz 2e73da4e25 update 2024-06-15 22:52:17 +02:00
slprimeandslprime 3fbc4eebac Fix find fluid from Bookmarks without amount (#16)
Co-authored-by: slprime <[email protected]>
2024-06-15 17:03:03 +02:00
Martin Robertz fc56416560 update 2024-05-22 21:24:01 +02:00
Oleg Ivanov 41e2db4644 Improvements and fixes (#15)
* Improvements and fixes

* Add config option not to search in EnderIO conduits
2024-05-22 19:28:12 +02:00
5 changed files with 24 additions and 3 deletions

No files matched your search

+3 -2
View File
@@ -1,6 +1,7 @@
// Add your dependencies here
dependencies {
implementation('com.github.GTNewHorizons:NotEnoughItems:2.6.0-GTNH:dev')
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.46.16:dev')
implementation('com.github.GTNewHorizons:NotEnoughItems:2.6.5-GTNH:dev')
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.48.37:dev')
compileOnly('com.github.GTNewHorizons:EnderIO:2.8.6:dev')
}
@@ -30,6 +30,7 @@ public class FindIt {
private boolean extraUtilitiesLoaded;
private boolean gregTechloaded;
private boolean enderIOloaded;
private SearchCooldownService cooldownService;
private BlockFindService blockFindService;
@@ -39,6 +40,8 @@ public class FindIt {
public void preInit(FMLPreInitializationEvent event) {
this.extraUtilitiesLoaded = Loader.isModLoaded("ExtraUtilities");
this.gregTechloaded = Loader.isModLoaded("gregtech");
this.enderIOloaded = Loader.isModLoaded("EnderIO");
FindItConfig.setup(event.getSuggestedConfigurationFile());
boolean isClient = event.getSide() == Side.CLIENT;
@@ -66,4 +69,8 @@ public class FindIt {
public static boolean isGregTechLoaded() {
return INSTANCE.gregTechloaded;
}
public static boolean isEnderIOLoaded() {
return INSTANCE.enderIOloaded;
}
}
@@ -13,6 +13,7 @@ public class FindItConfig {
public static boolean USE_PARTICLE_HIGHLIGHTER = false;
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;
@@ -45,6 +46,12 @@ public class FindItConfig {
"false",
"Search items & fluids in GT pipes").getBoolean();
SEARCH_IN_ENDERIO_CONDUITS = config.get(
Configuration.CATEGORY_GENERAL,
"SearchInEnderIOConduits",
"false",
"Search items & fluids in EnderIO conduits").getBoolean();
SEARCH_ITEMS_ON_GROUND = config.get(
Configuration.CATEGORY_GENERAL,
"SearchItemsOnGround",
@@ -41,7 +41,7 @@ public class FindItemRequest implements IMessage {
}
public boolean hasFluidStack() {
return targetFluidStack != null && targetFluidStack.amount > 0;
return targetFluidStack != null;
}
public boolean isFluidSatisfies(FluidStack fluid) {
@@ -19,6 +19,7 @@ import com.gtnh.findit.service.blockfinder.BlockFoundResponse;
import com.gtnh.findit.util.WorldUtils;
import cpw.mods.fml.relauncher.Side;
import crazypants.enderio.conduit.TileConduitBundle;
import gregtech.api.metatileentity.BaseMetaPipeEntity;
public class ItemFindService {
@@ -58,6 +59,11 @@ public class ItemFindService {
return false;
}
}
if (FindIt.isEnderIOLoaded()) {
if (!FindItConfig.SEARCH_IN_ENDERIO_CONDUITS && tileEntity instanceof TileConduitBundle) {
return false;
}
}
if (request.hasFluidStack()) {
if (tileEntity instanceof IFluidTank && request.isFluidSatisfies(((IFluidTank) tileEntity).getFluid())) {