aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/gtPlusPlus/core/lib/LoadedMods.java6
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java10
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/HazmatUtils.java4
-rw-r--r--src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java6
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/Preloader_FMLLoadingPlugin.java4
-rw-r--r--src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TT_ThaumicRestorer.java2
-rw-r--r--src/main/java/gtPlusPlus/preloader/keyboard/BetterKeyboard.java6
-rw-r--r--src/main/java/gtPlusPlus/xmod/bop/HANDLER_BiomesOPlenty.java26
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java4
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java26
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java58
11 files changed, 104 insertions, 48 deletions
diff --git a/src/main/java/gtPlusPlus/core/lib/LoadedMods.java b/src/main/java/gtPlusPlus/core/lib/LoadedMods.java
index 1eb8351d65..4f7a10be78 100644
--- a/src/main/java/gtPlusPlus/core/lib/LoadedMods.java
+++ b/src/main/java/gtPlusPlus/core/lib/LoadedMods.java
@@ -60,6 +60,7 @@ public class LoadedMods {
public static boolean CropsPlusPlus = false; //Barts Crop Mod
public static boolean Reliquary = false;
public static boolean SpiceOfLife = false;
+ public static boolean RemoteIO = false;
@@ -322,6 +323,11 @@ public class LoadedMods {
Witchery = true;
Logger.INFO("Components enabled for: Witchery");
totalMods++;
+ }
+ if (isModLoaded("RIO")){
+ RemoteIO = true;
+ Logger.INFO("Components enabled for: RemoteIO");
+ totalMods++;
}
Logger.INFO("Content found for "+totalMods+" mods");
diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java
index 985e783430..f708a99af0 100644
--- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java
+++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java
@@ -2764,11 +2764,11 @@ public class RECIPES_Machines {
return;
}
Class ModBlocksClass = ReflectionUtils.getClass("com.riciJak.Ztones.init.ModBlocks");
- Block agon = (Block) ReflectionUtils.getFieldValue( ReflectionUtils.getField(ModBlocksClass, "agonBlock"));
- Block korp = (Block) ReflectionUtils.getFieldValue( ReflectionUtils.getField(ModBlocksClass, "korpBlock"));
- Block jelt = (Block) ReflectionUtils.getFieldValue( ReflectionUtils.getField(ModBlocksClass, "jeltBlock"));
- Block bitt = (Block) ReflectionUtils.getFieldValue( ReflectionUtils.getField(ModBlocksClass, "bittBlock"));
- Block iszm = (Block) ReflectionUtils.getFieldValue( ReflectionUtils.getField(ModBlocksClass, "iszmBlock"));
+ Block agon = ReflectionUtils.getFieldValue( ReflectionUtils.getField(ModBlocksClass, "agonBlock"));
+ Block korp = ReflectionUtils.getFieldValue( ReflectionUtils.getField(ModBlocksClass, "korpBlock"));
+ Block jelt = ReflectionUtils.getFieldValue( ReflectionUtils.getField(ModBlocksClass, "jeltBlock"));
+ Block bitt = ReflectionUtils.getFieldValue( ReflectionUtils.getField(ModBlocksClass, "bittBlock"));
+ Block iszm = ReflectionUtils.getFieldValue( ReflectionUtils.getField(ModBlocksClass, "iszmBlock"));
// "agon", "iszm", "korp", "jelt", "bitt"
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/HazmatUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/HazmatUtils.java
index b322036ef7..0e2fff3f35 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/HazmatUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/HazmatUtils.java
@@ -254,7 +254,7 @@ public class HazmatUtils {
aItemFields.add(ReflectionUtils.getField(aItemsGravisuite, "graviChestPlate"));
AutoMap<ItemStack> aGravisuite = new AutoMap<ItemStack>();
for (Field aItemField : aItemFields) {
- Item aItemObject = (Item) ReflectionUtils.getFieldValue(aItemField);
+ Item aItemObject = ReflectionUtils.getFieldValue(aItemField);
if (aItemObject != null) {
aGravisuite.add(ItemUtils.getSimpleStack(aItemObject));
}
@@ -274,7 +274,7 @@ public class HazmatUtils {
aItemFields.add(ReflectionUtils.getField(aItemsEMT, "ultimateSolarHelmet"));
AutoMap<ItemStack> aASP = new AutoMap<ItemStack>();
for (Field aItemField : aItemFields) {
- Item aItemObject = (Item) ReflectionUtils.getFieldValue(aItemField);
+ Item aItemObject = ReflectionUtils.getFieldValue(aItemField);
if (aItemObject != null) {
aASP.add(ItemUtils.getSimpleStack(aItemObject));
}
diff --git a/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
index 1ef925f793..92804d72ec 100644
--- a/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
@@ -1060,13 +1060,13 @@ public class ReflectionUtils {
return false;
}
- public static Object getFieldValue(Field field) {
+ public static <T> T getFieldValue(Field field) {
return getFieldValue(field, null);
}
- public static Object getFieldValue(Field field, Object instance) {
+ public static <T> T getFieldValue(Field field, Object instance) {
try {
- return field.get(instance);
+ return (T) field.get(instance);
} catch (IllegalArgumentException | IllegalAccessException e) {
}
return null;
diff --git a/src/main/java/gtPlusPlus/preloader/asm/Preloader_FMLLoadingPlugin.java b/src/main/java/gtPlusPlus/preloader/asm/Preloader_FMLLoadingPlugin.java
index 22568e6de7..b52f4eb67e 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/Preloader_FMLLoadingPlugin.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/Preloader_FMLLoadingPlugin.java
@@ -76,8 +76,8 @@ public class Preloader_FMLLoadingPlugin implements IFMLLoadingPlugin {
Preloader_Logger.INFO("Running on "+gtPlusPlus.preloader.CORE_Preloader.JAVA_VERSION+" | Development Environment: "+CORE_Preloader.DEV_ENVIRONMENT);
Locale aDefaultLocale = Locale.getDefault();
NumberFormat aFormat = NumberFormat.getInstance();
- Locale aDisplayLocale = (Locale) ReflectionUtils.getFieldValue(ReflectionUtils.getField(Locale.class, "defaultDisplayLocale"));
- Locale aFormatLocale = (Locale) ReflectionUtils.getFieldValue(ReflectionUtils.getField(Locale.class, "defaultFormatLocale"));
+ Locale aDisplayLocale = ReflectionUtils.getFieldValue(ReflectionUtils.getField(Locale.class, "defaultDisplayLocale"));
+ Locale aFormatLocale = ReflectionUtils.getFieldValue(ReflectionUtils.getField(Locale.class, "defaultFormatLocale"));
Preloader_Logger.INFO("Locale: "+aDefaultLocale+" | Test: "+aFormat.format(1000000000)+" | Display: "+aDisplayLocale+" | Format: "+aFormatLocale);
}
diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TT_ThaumicRestorer.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TT_ThaumicRestorer.java
index 05b8054ff8..86a22ce4b9 100644
--- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TT_ThaumicRestorer.java
+++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_TT_ThaumicRestorer.java
@@ -82,7 +82,7 @@ public class ClassTransformer_TT_ThaumicRestorer {
mTookLastTick = ReflectionUtils.getField(mTileRepairerClass, "tookLastTick");
mDamageLastTick = ReflectionUtils.getField(mTileRepairerClass, "dmgLastTick");
mProxyTC = ReflectionUtils.getField(mThaumicTinkerer, "tcProxy");
- repairTConTools = (boolean) ReflectionUtils.getFieldValue(mRepairTiconTools);
+ repairTConTools = ReflectionUtils.getFieldValue(mRepairTiconTools);
mInit = true;
}
if (mInit) {
diff --git a/src/main/java/gtPlusPlus/preloader/keyboard/BetterKeyboard.java b/src/main/java/gtPlusPlus/preloader/keyboard/BetterKeyboard.java
index e25c06653c..532d20f1b2 100644
--- a/src/main/java/gtPlusPlus/preloader/keyboard/BetterKeyboard.java
+++ b/src/main/java/gtPlusPlus/preloader/keyboard/BetterKeyboard.java
@@ -68,7 +68,7 @@ public class BetterKeyboard {
Field aKeyNameSize = ReflectionUtils.getField(Keyboard.class, "keyName");
Field aKeyMapSize = ReflectionUtils.getField(Keyboard.class, "keyMap");
Field aKeyDownBuffer = ReflectionUtils.getField(Keyboard.class, "keyDownBuffer");
- String[] aOldKeyNameArray = (String[]) ReflectionUtils.getFieldValue(aKeyNameSize);
+ String[] aOldKeyNameArray = ReflectionUtils.getFieldValue(aKeyNameSize);
if (aOldKeyNameArray != null && aOldKeyNameArray.length < Short.MAX_VALUE) {
String[] aNewKeyNameArray = new String[Short.MAX_VALUE];
for (int i=0;i<aOldKeyNameArray.length;i++) {
@@ -82,7 +82,7 @@ public class BetterKeyboard {
FMLRelaunchLog.log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Failed Patching Field: "+aKeyDownBuffer.getName());
}
}
- Map<String, Integer> aOldKeyMapArray = (Map<String, Integer>) ReflectionUtils.getFieldValue(aKeyMapSize);
+ Map<String, Integer> aOldKeyMapArray = ReflectionUtils.getFieldValue(aKeyMapSize);
if (aOldKeyNameArray != null && aOldKeyMapArray.size() < Short.MAX_VALUE) {
Map<String, Integer> aNewKeyMapArray = new HashMap<String, Integer>(Short.MAX_VALUE);
aNewKeyMapArray.putAll(aOldKeyMapArray);
@@ -94,7 +94,7 @@ public class BetterKeyboard {
FMLRelaunchLog.log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Failed Patching Field: "+aKeyDownBuffer.getName());
}
}
- ByteBuffer aOldByteBuffer = (ByteBuffer) ReflectionUtils.getFieldValue(aKeyDownBuffer);
+ ByteBuffer aOldByteBuffer = ReflectionUtils.getFieldValue(aKeyDownBuffer);
if (aOldByteBuffer != null && aOldByteBuffer.capacity() == Keyboard.KEYBOARD_SIZE) {
ByteBuffer aNewByteBuffer = BufferUtils.createByteBuffer(Short.MAX_VALUE);
try {
diff --git a/src/main/java/gtPlusPlus/xmod/bop/HANDLER_BiomesOPlenty.java b/src/main/java/gtPlusPlus/xmod/bop/HANDLER_BiomesOPlenty.java
index 95067300c8..52f498988c 100644
--- a/src/main/java/gtPlusPlus/xmod/bop/HANDLER_BiomesOPlenty.java
+++ b/src/main/java/gtPlusPlus/xmod/bop/HANDLER_BiomesOPlenty.java
@@ -91,7 +91,7 @@ public class HANDLER_BiomesOPlenty {
Field aBopColouredSapling = ReflectionUtils.getField(ReflectionUtils.getClass("biomesoplenty.api.content.BOPCBlocks"), "colorizedSaplings");
if (aBopMiscItem != null) {
- Item aMiscItem = (Item) ReflectionUtils.getFieldValue(aBopMiscItem);
+ Item aMiscItem = ReflectionUtils.getFieldValue(aBopMiscItem);
if (aMiscItem != null) {
mPineCone = aMiscItem;
}
@@ -99,25 +99,25 @@ public class HANDLER_BiomesOPlenty {
if (aBopBlock1 != null) {
- Block aBlock = (Block) ReflectionUtils.getFieldValue(aBopBlock1);
+ Block aBlock = ReflectionUtils.getFieldValue(aBopBlock1);
if (aBlock != null) {
logs1 = aBlock;
}
}
if (aBopBlock2 != null) {
- Block aBlock = (Block) ReflectionUtils.getFieldValue(aBopBlock2);
+ Block aBlock = ReflectionUtils.getFieldValue(aBopBlock2);
if (aBlock != null) {
logs2 = aBlock;
}
}
if (aBopBlock3 != null) {
- Block aBlock = (Block) ReflectionUtils.getFieldValue(aBopBlock3);
+ Block aBlock = ReflectionUtils.getFieldValue(aBopBlock3);
if (aBlock != null) {
logs3 = aBlock;
}
}
if (aBopBlock4 != null) {
- Block aBlock = (Block) ReflectionUtils.getFieldValue(aBopBlock4);
+ Block aBlock = ReflectionUtils.getFieldValue(aBopBlock4);
if (aBlock != null) {
logs4 = aBlock;
}
@@ -125,25 +125,25 @@ public class HANDLER_BiomesOPlenty {
if (aBopLeaves1 != null) {
- Block aBlock = (Block) ReflectionUtils.getFieldValue(aBopLeaves1);
+ Block aBlock = ReflectionUtils.getFieldValue(aBopLeaves1);
if (aBlock != null) {
leaves1 = aBlock;
}
}
if (aBopLeaves2 != null) {
- Block aBlock = (Block) ReflectionUtils.getFieldValue(aBopLeaves2);
+ Block aBlock = ReflectionUtils.getFieldValue(aBopLeaves2);
if (aBlock != null) {
leaves2 = aBlock;
}
}
if (aBopLeaves3 != null) {
- Block aBlock = (Block) ReflectionUtils.getFieldValue(aBopLeaves3);
+ Block aBlock = ReflectionUtils.getFieldValue(aBopLeaves3);
if (aBlock != null) {
leaves3 = aBlock;
}
}
if (aBopLeaves4 != null) {
- Block aBlock = (Block) ReflectionUtils.getFieldValue(aBopLeaves4);
+ Block aBlock = ReflectionUtils.getFieldValue(aBopLeaves4);
if (aBlock != null) {
leaves4 = aBlock;
}
@@ -151,13 +151,13 @@ public class HANDLER_BiomesOPlenty {
if (aBopColouredLeaves1 != null) {
- Block aBlock = (Block) ReflectionUtils.getFieldValue(aBopColouredLeaves1);
+ Block aBlock = ReflectionUtils.getFieldValue(aBopColouredLeaves1);
if (aBlock != null) {
colorizedLeaves1 = aBlock;
}
}
if (aBopColouredLeaves2 != null) {
- Block aBlock = (Block) ReflectionUtils.getFieldValue(aBopColouredLeaves2);
+ Block aBlock = ReflectionUtils.getFieldValue(aBopColouredLeaves2);
if (aBlock != null) {
colorizedLeaves2 = aBlock;
}
@@ -165,13 +165,13 @@ public class HANDLER_BiomesOPlenty {
if (aBopSapling != null) {
- Block aBlock = (Block) ReflectionUtils.getFieldValue(aBopSapling);
+ Block aBlock = ReflectionUtils.getFieldValue(aBopSapling);
if (aBlock != null) {
saplings = aBlock;
}
}
if (aBopColouredSapling != null) {
- Block aBlock = (Block) ReflectionUtils.getFieldValue(aBopColouredSapling);
+ Block aBlock = ReflectionUtils.getFieldValue(aBopColouredSapling);
if (aBlock != null) {
colorizedSaplings = aBlock;
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java
index 5ebb2da8d4..d70afcb433 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java
@@ -29,7 +29,7 @@ public class GT_MetaTileEntity_Hatch_AirIntake_Extreme extends GT_MetaTileEntity
String[] aTooltip = new String[3];
aTooltip[0] = "DO NOT OBSTRUCT THE INPUT!";
aTooltip[1] = "Draws in Air from the surrounding environment";
- aTooltip[2] = "Creates 5000L of Air every 4 ticks";
+ aTooltip[2] = "Creates 8000L of Air every 4 ticks";
return aTooltip;
}
@@ -40,7 +40,7 @@ public class GT_MetaTileEntity_Hatch_AirIntake_Extreme extends GT_MetaTileEntity
@Override
public int getAmountOfFluidToGenerate() {
- return 5000;
+ return 8000;
}
@Override
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java
index 7579c8ec5a..d4b8b3a064 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java
@@ -178,31 +178,29 @@ public abstract class GT_MetaTileEntity_Hatch_FluidGenerator extends GT_MetaTile
return true;
}
- public boolean isAirInHatch() {
- if (this.mFluid != null) {
- if (getFluidToGenerate() == this.mFluid.getFluid()) {
- return true;
- }
- }
- return false;
- }
-
public abstract boolean doesHatchMeetConditionsToGenerate();
public boolean addFluidToHatch(long aTick) {
if (!doesHatchMeetConditionsToGenerate()) {
return false;
- }
- boolean didFill = this.fill(FluidUtils.getFluidStack(getFluidToGenerate(), getAmountOfFluidToGenerate()), true) > 0;
- if (didFill) {
- this.generateParticles(this.getBaseMetaTileEntity().getWorld(), "cloud");
+ }
+ boolean didFill = false;
+ if (canTankBeFilled()) {
+ didFill = this.fill(FluidUtils.getFluidStack(getFluidToGenerate(), getAmountOfFluidToGenerate()), true) > 0;
+ if (didFill) {
+ this.generateParticles(this.getBaseMetaTileEntity().getWorld(), "cloud");
+ }
}
return didFill;
}
@Override
public boolean canTankBeFilled() {
- if (this.mFluid == null || (this.mFluid != null && (this.mFluid.amount <= this.getCapacity()))) {
+ //Logger.INFO("Total Space: "+this.getCapacity());
+ //Logger.INFO("Current capacity: "+this.getFluidAmount());
+ //Logger.INFO("To add: "+this.getAmountOfFluidToGenerate());
+ //Logger.INFO("Space Free: "+(this.getCapacity()-this.getFluidAmount()));
+ if (this.mFluid == null || (this.mFluid != null && (this.getCapacity() - this.getFluidAmount() >= this.getAmountOfFluidToGenerate()))) {
return true;
}
return false;
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java
index 5cd57e9e92..a2aa4d266c 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java
@@ -1,20 +1,32 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.IIconContainer;
+import java.lang.reflect.Field;
+
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.objects.GT_RenderedTexture;
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
+import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.IFluidHandler;
public class GT_MetaTileEntity_Hatch_Reservoir extends GT_MetaTileEntity_Hatch_FluidGenerator {
+ private static Class sClass_EIO;
+ private static Class sClass_RIO;
+ private static Field sField_EIO;
+ private static Field sField_RIO;
+ private static Block sBlock_EIO;
+ private static Block sBlock_RIO;
+
public GT_MetaTileEntity_Hatch_Reservoir(final int aID, final String aName, final String aNameRegional, final int aTier) {
super(aID, aName, aNameRegional, aTier);
}
@@ -56,11 +68,51 @@ public class GT_MetaTileEntity_Hatch_Reservoir extends GT_MetaTileEntity_Hatch_F
public int getCapacity() {
return 128000;
}
+
+ private static void setCrossModData() {
+ if (LoadedMods.EnderIO && sClass_EIO == null) {
+ sClass_EIO = ReflectionUtils.getClass("crazypants.enderio.EnderIO");
+ sField_EIO = ReflectionUtils.getField(sClass_EIO, "blockReservoir");
+ sBlock_EIO = ReflectionUtils.getFieldValue(sField_EIO, null);
+ }
+ if (LoadedMods.RemoteIO && sClass_RIO == null) {
+ sClass_RIO = ReflectionUtils.getClass("remoteio.common.lib.ModBlocks");
+ sField_RIO = ReflectionUtils.getField(sClass_RIO, "machine");
+ sBlock_RIO = ReflectionUtils.getFieldValue(sField_RIO, null);
+ }
+ }
+
+ public static boolean isTileValid(TileEntity aTile) {
+ if (aTile != null) {
+ if (aTile instanceof IFluidHandler) {
+ IFluidHandler aFluidHandler = (IFluidHandler) aTile;
+ return aFluidHandler.canDrain(ForgeDirection.UNKNOWN, FluidRegistry.WATER);
+ }
+ }
+ return false;
+ }
@Override
public boolean doesHatchMeetConditionsToGenerate() {
Block aWater = this.getBaseMetaTileEntity().getBlockAtSide(this.getBaseMetaTileEntity().getFrontFacing());
- return aWater == Blocks.water || aWater == Blocks.flowing_water;
+ if (aWater != null && aWater != Blocks.air) {
+ if (!this.canTankBeFilled()) {
+ return false;
+ }
+ setCrossModData();
+ if (LoadedMods.EnderIO) {
+ if (aWater == sBlock_EIO) {
+ return isTileValid(this.getBaseMetaTileEntity().getTileEntityAtSide(this.getBaseMetaTileEntity().getFrontFacing()));
+ }
+ }
+ if (LoadedMods.RemoteIO) {
+ if (aWater == sBlock_RIO && this.getBaseMetaTileEntity().getMetaIDAtSide(this.getBaseMetaTileEntity().getFrontFacing()) == 0) {
+ return isTileValid(this.getBaseMetaTileEntity().getTileEntityAtSide(this.getBaseMetaTileEntity().getFrontFacing()));
+ }
+ }
+ return aWater == Blocks.water || aWater == Blocks.flowing_water;
+ }
+ return false;
}
@Override