aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/common')
-rw-r--r--src/main/java/gregtech/common/GT_ThaumcraftCompat.java4
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_Arm.java5
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java5
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_Crafting.java5
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java5
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_Drain.java4
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java5
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java5
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java5
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java4
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_ItemFilter.java5
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java23
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_Lens.java5
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java5
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java5
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java5
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_Pump.java5
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java5
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverExternal.java5
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java5
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java5
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_Screen.java5
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_Shutter.java5
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_SolarPanel.java5
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_SteamValve.java6
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_Vent.java5
-rw-r--r--src/main/java/gregtech/common/entities/GT_Entity_Arrow.java2
-rw-r--r--src/main/java/gregtech/common/gui/GT_Container_Regulator.java2
-rw-r--r--src/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java2
-rw-r--r--src/main/java/gregtech/common/items/behaviors/Behaviour_Sonictron.java2
-rw-r--r--src/main/java/gregtech/common/render/GT_FluidDisplayStackRenderer.java2
-rw-r--r--src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java24
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java113
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java8
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java4
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java2
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java2
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java2
-rw-r--r--src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java5
39 files changed, 277 insertions, 39 deletions
diff --git a/src/main/java/gregtech/common/GT_ThaumcraftCompat.java b/src/main/java/gregtech/common/GT_ThaumcraftCompat.java
index bc6372e41c..e4472824e7 100644
--- a/src/main/java/gregtech/common/GT_ThaumcraftCompat.java
+++ b/src/main/java/gregtech/common/GT_ThaumcraftCompat.java
@@ -182,7 +182,7 @@ public class GT_ThaumcraftCompat implements IThaumcraftCompat {
if ((GT_Utility.isStringInvalid(aResearch)) || (aInput == null) || (aOutput == null) || (aAspects == null) || (aAspects.isEmpty())) {
return null;
}
- return ThaumcraftApi.addCrucibleRecipe(aResearch, GT_Utility.copy(new Object[]{aOutput}), ((aInput instanceof ItemStack)) || ((aInput instanceof ArrayList)) ? aInput : aInput.toString(), getAspectList(aAspects));
+ return ThaumcraftApi.addCrucibleRecipe(aResearch, GT_Utility.copyOrNull(aOutput), ((aInput instanceof ItemStack)) || ((aInput instanceof ArrayList)) ? aInput : aInput.toString(), getAspectList(aAspects));
}
@Override
@@ -190,7 +190,7 @@ public class GT_ThaumcraftCompat implements IThaumcraftCompat {
if ((GT_Utility.isStringInvalid(aResearch)) || (aMainInput == null) || (aSideInputs == null) || (aOutput == null) || (aAspects == null) || (aAspects.isEmpty())) {
return null;
}
- return ThaumcraftApi.addInfusionCraftingRecipe(aResearch, GT_Utility.copy(new Object[]{aOutput}), aInstability, getAspectList(aAspects), aMainInput, aSideInputs);
+ return ThaumcraftApi.addInfusionCraftingRecipe(aResearch, GT_Utility.copyOrNull(aOutput), aInstability, getAspectList(aAspects), aMainInput, aSideInputs);
}
@Override
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Arm.java b/src/main/java/gregtech/common/covers/GT_Cover_Arm.java
index c686f99c0b..ed60929719 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_Arm.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_Arm.java
@@ -31,6 +31,11 @@ public class GT_Cover_Arm extends GT_CoverBehavior {
}
@Override
+ public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ return false;
+ }
+
+ @Override
public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
if ((((aTileEntity instanceof IMachineProgress)) && (!((IMachineProgress) aTileEntity).isAllowedToWork()))) {
return aCoverVariable;
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java
index b86f950e23..de3dd5c4d7 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java
@@ -31,6 +31,11 @@ public class GT_Cover_Conveyor extends GT_CoverBehavior {
}
@Override
+ public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ return false;
+ }
+
+ @Override
public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
if ((aCoverVariable % 6 > 1) && ((aTileEntity instanceof IMachineProgress))) {
if (((IMachineProgress) aTileEntity).isAllowedToWork() != aCoverVariable % 6 < 4) {
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Crafting.java b/src/main/java/gregtech/common/covers/GT_Cover_Crafting.java
index 3cf0742d52..0bed5423dd 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_Crafting.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_Crafting.java
@@ -9,6 +9,11 @@ import net.minecraft.network.play.server.S2DPacketOpenWindow;
public class GT_Cover_Crafting extends GT_CoverBehavior {
@Override
+ public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ return false;
+ }
+
+ @Override
public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) {
if ((aPlayer instanceof EntityPlayerMP)) {
((EntityPlayerMP) aPlayer).getNextWindowId();
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java b/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java
index fbbaa32472..49741d4091 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java
@@ -16,6 +16,11 @@ import net.minecraftforge.fluids.Fluid;
public class GT_Cover_DoesWork extends GT_CoverBehavior {
@Override
+ public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ return false;
+ }
+
+ @Override
public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
if ((aTileEntity instanceof IMachineProgress)) {
if (aCoverVariable < 2) {
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Drain.java b/src/main/java/gregtech/common/covers/GT_Cover_Drain.java
index 5fa2244761..8dd2dbddaa 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_Drain.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_Drain.java
@@ -16,6 +16,10 @@ import net.minecraftforge.fluids.IFluidHandler;
public class GT_Cover_Drain extends GT_CoverBehavior {
@Override
+ public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ return false;
+ }
+ @Override
public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
if ((aCoverVariable % 3 > 1) && ((aTileEntity instanceof IMachineProgress))) {
if (((IMachineProgress) aTileEntity).isAllowedToWork() != aCoverVariable % 3 < 2) {
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java
index 3af57ad081..1da5f2a6e2 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java
@@ -21,6 +21,11 @@ import net.minecraftforge.fluids.Fluid;
public class GT_Cover_EUMeter extends GT_CoverBehavior {
@Override
+ public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ return false;
+ }
+
+ @Override
public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
long tScale = 0L;
if (aCoverVariable < 2) {
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java b/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java
index 6326cbbe41..fa60fcb374 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java
@@ -9,6 +9,11 @@ import net.minecraftforge.fluids.Fluid;
public class GT_Cover_EnergyOnly extends GT_CoverBehavior {
@Override
+ public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ return false;
+ }
+
+ @Override
public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) {
aCoverVariable = (aCoverVariable + 1) % 3;
switch(aCoverVariable) {
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java b/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java
index d68b29e61b..a53545802a 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java
@@ -64,6 +64,11 @@ public class GT_Cover_FluidRegulator extends GT_CoverBehavior {
}
@Override
+ public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ return false;
+ }
+
+ @Override
public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
long aTimer) {
int tSpeed = getSpeed(aCoverVariable);
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java b/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java
index 0c0cb27d1f..7aab35ddaa 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java
@@ -39,6 +39,10 @@ public class GT_Cover_Fluidfilter extends GT_CoverBehavior {
return(String.format("Filtering Fluid: %s Mode: %s", sFluid.getLocalizedName(), getFilterMode(aFilterMode)));
}
+ @Override
+ public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ return false;
+ }
@Override
public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ItemFilter.java b/src/main/java/gregtech/common/covers/GT_Cover_ItemFilter.java
index 90c09f8168..99003e18e0 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_ItemFilter.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_ItemFilter.java
@@ -29,6 +29,11 @@ public class GT_Cover_ItemFilter extends GT_CoverBehavior {
}
@Override
+ public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ return false;
+ }
+
+ @Override
public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
TileEntity tTileEntity = aTileEntity.getTileEntityAtSide(aSide);
Object fromEntity = mExport ? aTileEntity : tTileEntity,
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java
index 5d26f2079e..f1c1bc7df7 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java
@@ -6,10 +6,13 @@ import gregtech.api.gui.widgets.GT_GuiFakeItemButton;
import gregtech.api.gui.widgets.GT_GuiIcon;
import gregtech.api.gui.widgets.GT_GuiIconCheckButton;
import gregtech.api.gui.widgets.GT_GuiIntegerTextBox;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.ICoverable;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.net.GT_Packet_TileEntityCover;
import gregtech.api.util.GT_CoverBehavior;
import gregtech.api.util.GT_Utility;
+import gregtech.common.tileentities.machines.GT_MetaTileEntity_Hatch_OutputBus_ME;
import gregtech.common.tileentities.storage.GT_MetaTileEntity_DigitalChestBase;
import net.minecraft.client.gui.GuiButton;
@@ -26,6 +29,11 @@ public class GT_Cover_ItemMeter extends GT_CoverBehavior {
private static final int INVERT_BIT = 0x40000000;
@Override
+ public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ return false;
+ }
+
+ @Override
public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
//Convert from ver. 5.09.33.50
if ((CONVERTED_BIT & aCoverVariable) == 0)
@@ -38,13 +46,22 @@ public class GT_Cover_ItemMeter extends GT_CoverBehavior {
long tMax = 0;
long tUsed = 0;
- if (aTileEntity instanceof GT_MetaTileEntity_DigitalChestBase) {
- GT_MetaTileEntity_DigitalChestBase dc = (GT_MetaTileEntity_DigitalChestBase)aTileEntity;
+ IMetaTileEntity mte = ((IGregTechTileEntity)aTileEntity).getMetaTileEntity();
+ if (mte instanceof GT_MetaTileEntity_DigitalChestBase) {
+ GT_MetaTileEntity_DigitalChestBase dc = (GT_MetaTileEntity_DigitalChestBase)mte;
tMax = dc.getMaxItemCount(); // currently it is limited by int, but there is not much reason for that
ItemStack[] inv = dc.getStoredItemData();
if (inv != null && inv.length > 1 && inv[1] != null)
tUsed = inv[1].stackSize;
- } else {
+ }
+ else if (mte instanceof GT_MetaTileEntity_Hatch_OutputBus_ME) {
+ if (((GT_MetaTileEntity_Hatch_OutputBus_ME)mte).isLastOutputFailed())
+ {
+ tMax = 64;
+ tUsed = 64;
+ }
+ }
+ else {
int[] tSlots = (aCoverVariable & SLOT_MASK) > 0 ?
new int[] {(aCoverVariable & SLOT_MASK) - 1} :
aTileEntity.getAccessibleSlotsFromSide(aSide);
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Lens.java b/src/main/java/gregtech/common/covers/GT_Cover_Lens.java
index 347a6acfcc..37405e6fa8 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_Lens.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_Lens.java
@@ -11,6 +11,11 @@ public class GT_Cover_Lens extends GT_CoverBehavior {
}
@Override
+ public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ return false;
+ }
+
+ @Override
public byte getLensColor(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
return this.mColor;
}
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java
index 9fa819cd33..ed75bca967 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java
@@ -18,6 +18,11 @@ import net.minecraftforge.fluids.IFluidHandler;
public class GT_Cover_LiquidMeter extends GT_CoverBehavior {
@Override
+ public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ return false;
+ }
+
+ @Override
public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
if ((aTileEntity instanceof IFluidHandler)) {
FluidTankInfo[] tTanks = ((IFluidHandler) aTileEntity).getTankInfo(ForgeDirection.UNKNOWN);
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java b/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java
index 5a5d02b71d..50b7c443d7 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java
@@ -24,6 +24,11 @@ public class GT_Cover_NeedMaintainance extends GT_CoverBehavior {
}
@Override
+ public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ return false;
+ }
+
+ @Override
public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
boolean needsRepair = false;
if (aTileEntity instanceof IGregTechTileEntity) {
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java b/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java
index 5857c92dab..b57299ed94 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java
@@ -20,6 +20,11 @@ public class GT_Cover_PlayerDetector extends GT_CoverBehavior {
private int range = 8;
@Override
+ public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ return false;
+ }
+
+ @Override
public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
boolean playerDetected = false;
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Pump.java b/src/main/java/gregtech/common/covers/GT_Cover_Pump.java
index a5b860c0a4..3d937d43fb 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_Pump.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_Pump.java
@@ -24,6 +24,11 @@ public class GT_Cover_Pump extends GT_CoverBehavior{
}
@Override
+ public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ return false;
+ }
+
+ @Override
public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
if ((aCoverVariable % 6 > 1) && ((aTileEntity instanceof IMachineProgress))) {
if (((IMachineProgress) aTileEntity).isAllowedToWork() != aCoverVariable % 6 < 4) {
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java
index 41d1861ca1..697d80a243 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java
@@ -8,6 +8,11 @@ import net.minecraftforge.fluids.Fluid;
public class GT_Cover_RedstoneConductor extends GT_CoverBehavior {
@Override
+ public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ return false;
+ }
+
+ @Override
public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
if (aCoverVariable == 0) {
aTileEntity.setOutputRedstoneSignal(aSide, aTileEntity.getStrongestRedstone());
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverExternal.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverExternal.java
index 0bf008419b..a4649629d8 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverExternal.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverExternal.java
@@ -5,6 +5,11 @@ import gregtech.api.interfaces.tileentity.ICoverable;
public class GT_Cover_RedstoneReceiverExternal extends GT_Cover_RedstoneWirelessBase {
@Override
+ public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ return false;
+ }
+
+ @Override
public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
aTileEntity.setOutputRedstoneSignal(aSide, GregTech_API.sWirelessRedstone.get(Integer.valueOf(aCoverVariable)) == null ? 0 : ((Byte) GregTech_API.sWirelessRedstone.get(Integer.valueOf(aCoverVariable))).byteValue());
return aCoverVariable;
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java
index cf322e78f1..221f5ea5ce 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java
@@ -9,6 +9,11 @@ import net.minecraftforge.fluids.Fluid;
public class GT_Cover_RedstoneSignalizer extends GT_CoverBehavior {
@Override
+ public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ return false;
+ }
+
+ @Override
public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) {
aCoverVariable = (aCoverVariable + 1) % 48;
switch(aCoverVariable / 16) {
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java
index 1c683966f9..94741f6b36 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java
@@ -5,6 +5,11 @@ import gregtech.api.interfaces.tileentity.ICoverable;
public class GT_Cover_RedstoneTransmitterInternal extends GT_Cover_RedstoneWirelessBase {
@Override
+ public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ return false;
+ }
+
+ @Override
public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
GregTech_API.sWirelessRedstone.put(Integer.valueOf(aCoverVariable), Byte.valueOf(aTileEntity.getOutputRedstoneSignal(aSide)));
return aCoverVariable;
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Screen.java b/src/main/java/gregtech/common/covers/GT_Cover_Screen.java
index afa79b5993..c0de124a7a 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_Screen.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_Screen.java
@@ -7,6 +7,11 @@ import net.minecraftforge.fluids.Fluid;
public class GT_Cover_Screen extends GT_CoverBehavior {
@Override
+ public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ return false;
+ }
+
+ @Override
public float getBlastProofLevel(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
return 20.0F;
}
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java b/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java
index fbf5ccca33..6fdc69e0fa 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java
@@ -15,6 +15,11 @@ import net.minecraftforge.fluids.Fluid;
public class GT_Cover_Shutter extends GT_CoverBehavior {
@Override
+ public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ return false;
+ }
+
+ @Override
public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
return aCoverVariable;
}
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_SolarPanel.java b/src/main/java/gregtech/common/covers/GT_Cover_SolarPanel.java
index 001dc3c023..ae1b73b8cb 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_SolarPanel.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_SolarPanel.java
@@ -17,6 +17,11 @@ public class GT_Cover_SolarPanel extends GT_CoverBehavior {
}
@Override
+ public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ return false;
+ }
+
+ @Override
public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
if(aSide != 1)return 0;
int coverState=aCoverVariable&0x3;
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_SteamValve.java b/src/main/java/gregtech/common/covers/GT_Cover_SteamValve.java
index 8ac8a0dae9..8d4ac949b7 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_SteamValve.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_SteamValve.java
@@ -1,5 +1,6 @@
package gregtech.common.covers;
+import gregtech.api.interfaces.tileentity.ICoverable;
import gregtech.api.util.GT_ModHandler;
import net.minecraftforge.fluids.FluidStack;
@@ -10,6 +11,11 @@ public class GT_Cover_SteamValve extends GT_Cover_Pump {
}
@Override
+ public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ return false;
+ }
+
+ @Override
protected boolean canTransferFluid(FluidStack fluid) {
return GT_ModHandler.isAnySteam(fluid);
}
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Vent.java b/src/main/java/gregtech/common/covers/GT_Cover_Vent.java
index 869235e011..64347d48e2 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_Vent.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_Vent.java
@@ -13,6 +13,11 @@ public class GT_Cover_Vent extends GT_CoverBehavior {
}
@Override
+ public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ return false;
+ }
+
+ @Override
public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
if ((aTileEntity instanceof IMachineProgress)) {
if ((((IMachineProgress) aTileEntity).hasThingsToDo()) && (aCoverVariable != ((IMachineProgress) aTileEntity).getProgress()) &&
diff --git a/src/main/java/gregtech/common/entities/GT_Entity_Arrow.java b/src/main/java/gregtech/common/entities/GT_Entity_Arrow.java
index b7c87b4860..7a44ade127 100644
--- a/src/main/java/gregtech/common/entities/GT_Entity_Arrow.java
+++ b/src/main/java/gregtech/common/entities/GT_Entity_Arrow.java
@@ -345,7 +345,7 @@ public class GT_Entity_Arrow extends EntityArrow {
}
public ItemStack getArrowItem() {
- return GT_Utility.copy(this.mArrow);
+ return GT_Utility.copyOrNull(this.mArrow);
}
public void setArrowItem(ItemStack aStack) {
diff --git a/src/main/java/gregtech/common/gui/GT_Container_Regulator.java b/src/main/java/gregtech/common/gui/GT_Container_Regulator.java
index f432c9b5d5..f50ac2dae3 100644
--- a/src/main/java/gregtech/common/gui/GT_Container_Regulator.java
+++ b/src/main/java/gregtech/common/gui/GT_Container_Regulator.java
@@ -81,7 +81,7 @@ public class GT_Container_Regulator extends GT_ContainerMetaTile_Machine {
if ((aSlotIndex < 19)) {
ItemStack tStack = aPlayer.inventory.getItemStack();
if (tStack != null) {
- tSlot.putStack(GT_Utility.copy(new Object[]{tStack}));
+ tSlot.putStack(GT_Utility.copyOrNull(tStack));
} else if (tSlot.getStack() != null) {
if (aMouseclick == 0) {
tSlot.getStack().stackSize -= (aShifthold == 1 ? 8 : 1);
diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java
index b909593694..a5393cdec5 100644
--- a/src/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java
+++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java
@@ -14,7 +14,7 @@ public class Behaviour_DataOrb extends Behaviour_None {
if (aNewContent[i] == null) {
aInventory[i] = null;
} else {
- aInventory[i] = GT_Utility.copy(new Object[]{aNewContent[i]});
+ aInventory[i] = GT_Utility.copyOrNull(aNewContent[i]);
}
}
}
diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Sonictron.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Sonictron.java
index a0dea777f7..bcaa8242f3 100644
--- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Sonictron.java
+++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Sonictron.java
@@ -90,7 +90,7 @@ public class Behaviour_Sonictron extends Behaviour_None {
if (aNewContent[i] == null) {
aInventory[i] = null;
} else {
- aInventory[i] = GT_Utility.copy(aNewContent[i]);
+ aInventory[i] = GT_Utility.copyOrNull(aNewContent[i]);
}
}
}
diff --git a/src/main/java/gregtech/common/render/GT_FluidDisplayStackRenderer.java b/src/main/java/gregtech/common/render/GT_FluidDisplayStackRenderer.java
index ef5d8287ba..c4e23eab6e 100644
--- a/src/main/java/gregtech/common/render/GT_FluidDisplayStackRenderer.java
+++ b/src/main/java/gregtech/common/render/GT_FluidDisplayStackRenderer.java
@@ -67,7 +67,7 @@ public class GT_FluidDisplayStackRenderer implements IItemRenderer {
// Render Fluid amount text
long fluidAmount = item.getTagCompound().getLong("mFluidDisplayAmount");
- if (fluidAmount > 0L) {
+ if (fluidAmount > 0L && !item.getTagCompound().getBoolean("mHideStackSize")) {
String amountString;
if (fluidAmount < 10000) {
diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java
index 7b0723f37d..c71126b146 100644
--- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java
+++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java
@@ -23,11 +23,19 @@ import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_TOP;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE;
public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler {
+
+ public static final int COOLDOWN_INTERVAL = 20;
+ public static final int ENERGY_PER_LAVA = 1;
+ public static final int CONSUMPTION_PER_HEATUP = 3;
+ public static final int PRODUCTION_PER_SECOND = 600;
+ public static final int POLLUTION_PER_SECOND = 20;
+
public GT_MetaTileEntity_Boiler_Lava(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, new String[]{
"A Boiler running off Lava",
- "Produces 600L of Steam per second",
- "Causes 20 Pollution per second"});
+ "Produces " + PRODUCTION_PER_SECOND + "L of Steam per second",
+ "Causes " + POLLUTION_PER_SECOND + " Pollution per second",
+ "Consumes " + ((double) CONSUMPTION_PER_HEATUP / ENERGY_PER_LAVA) + "L of Lava every " + COOLDOWN_INTERVAL + " ticks when fully heat up"});
}
public GT_MetaTileEntity_Boiler_Lava(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
@@ -85,12 +93,12 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler {
@Override
protected int getPollution() {
- return 20;
+ return POLLUTION_PER_SECOND;
}
@Override
protected int getProductionPerSecond() {
- return 600;
+ return PRODUCTION_PER_SECOND;
}
@Override
@@ -100,18 +108,18 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler {
@Override
protected int getEnergyConsumption() {
- return 3;
+ return CONSUMPTION_PER_HEATUP;
}
@Override
protected int getCooldownInterval() {
- return 20;
+ return COOLDOWN_INTERVAL;
}
@Override
protected void updateFuel(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.bucket.get(Materials.Lava))) {
- this.mProcessingEnergy += 1000;
+ this.mProcessingEnergy += 1000 * ENERGY_PER_LAVA;
aBaseMetaTileEntity.decrStackSize(2, 1);
aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.bucket, Materials.Empty, 1L));
}
@@ -122,7 +130,7 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler {
if ((GT_ModHandler.isLava(aFluid)) && (this.mProcessingEnergy < 50)) {
int tFilledAmount = Math.min(50, aFluid.amount);
if (doFill) {
- this.mProcessingEnergy += tFilledAmount;
+ this.mProcessingEnergy += tFilledAmount * ENERGY_PER_LAVA;
}
return tFilledAmount;
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java
index 12d839d221..ef3689f64c 100644
--- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java
+++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java
@@ -21,8 +21,12 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus;
import gregtech.api.render.TextureFactory;
+import gregtech.api.util.GT_Utility;
+
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTBase;
+import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ME_HATCH;
@@ -30,6 +34,10 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ME_HATCH;
public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatch_OutputBus {
private BaseActionSource requestSource = null;
private AENetworkProxy gridProxy = null;
+ ItemStack cachedStack = null;
+ long lastOutputTick = 0;
+ long tickCounter = 0;
+ boolean lastOutputFailed = false;
public GT_MetaTileEntity_Hatch_OutputBus_ME(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, 1, new String[]{
@@ -65,12 +73,16 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc
public boolean storeAll(ItemStack aStack) {
if (!GregTech_API.mAE2)
return false;
- int tTotal = aStack.stackSize;
- int tStored = store(aStack);
- aStack.stackSize -= tStored;
- return tTotal == tStored;
+ aStack.stackSize = store(aStack);
+ return aStack.stackSize == 0;
}
+ /**
+ * Attempt to store items in connected ME network. Returns how many items did not fit (if the network was down e.g.)
+ *
+ * @param stack input stack
+ * @return amount of items left over
+ */
@Optional.Method(modid = "appliedenergistics2")
public int store(final ItemStack stack) {
if (stack == null)
@@ -78,17 +90,67 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc
try {
AENetworkProxy proxy = getProxy();
if (proxy == null)
- return stack.stackSize;
- IMEMonitor<IAEItemStack> sg = proxy.getStorage().getItemInventory();
- final IEnergySource src = proxy.getEnergy();
- IAEItemStack toStore = AEApi.instance().storage().createItemStack(stack);
- IAEItemStack rest = Platform.poweredInsert( src, sg, toStore, getRequest());
- if (rest != null)
- return (int)rest.getStackSize();
+ {
+ lastOutputFailed = true;
+ int cacheSize = cachedStack == null ? 0 : cachedStack.stackSize;
+ cachedStack = null;
+ return stack.stackSize + cacheSize;
+ }
+ if (lastOutputFailed) // if last output failed, don't buffer
+ {
+ IMEMonitor<IAEItemStack> sg = proxy.getStorage().getItemInventory();
+ IAEItemStack toStore = AEApi.instance().storage().createItemStack(stack);
+ IAEItemStack rest = Platform.poweredInsert(proxy.getEnergy(), sg, toStore, getRequest());
+ if (rest != null && rest.getStackSize() > 0)
+ return (int) rest.getStackSize();
+ else
+ lastOutputFailed = false;
+ }
+ else if (cachedStack != null && ((tickCounter > (lastOutputTick+20)) || !cachedStack.isItemEqual(stack)))
+ {
+ lastOutputTick = tickCounter;
+ boolean sameStack = cachedStack.isItemEqual(stack);
+ if (sameStack)
+ cachedStack.stackSize += stack.stackSize;
+ IMEMonitor<IAEItemStack> sg = proxy.getStorage().getItemInventory();
+ IAEItemStack toStore = AEApi.instance().storage().createItemStack(cachedStack);
+ IAEItemStack rest = Platform.poweredInsert(proxy.getEnergy(), sg, toStore, getRequest());
+ if (rest != null && rest.getStackSize() > 0)
+ {
+ lastOutputFailed = true;
+ cachedStack.stackSize = (int)rest.getStackSize();
+ if (sameStack) // return all that was cached to sender
+ {
+ cachedStack = null;
+ return (int) rest.getStackSize();
+ }
+ else // leave the cache, and return input to sender
+ {
+ cachedStack.stackSize = (int)rest.getStackSize();
+ return stack.stackSize;
+ }
+ }
+ else
+ {
+ if (!sameStack)
+ cachedStack = stack.copy();
+ else
+ cachedStack = null;
+ return 0;
+ }
+ }
+ else
+ {
+ if (cachedStack == null)
+ cachedStack = stack.copy();
+ else
+ cachedStack.stackSize += stack.stackSize;
+ }
return 0;
}
catch( final GridAccessException ignored )
{
+ lastOutputFailed = true;
}
return stack.stackSize;
}
@@ -128,4 +190,33 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc
@Optional.Method(modid = "appliedenergistics2")
public void gridChanged() {
}
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ tickCounter = aTick;
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT)
+ {
+ super.saveNBTData(aNBT);
+ if (cachedStack != null) {
+ NBTTagCompound tTag = new NBTTagCompound();
+ cachedStack.writeToNBT(tTag);
+ aNBT.setTag("cachedStack", tTag);
+ }
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ NBTBase t = aNBT.getTag("cachedStack");
+ if (t instanceof NBTTagCompound)
+ cachedStack = GT_Utility.loadItem((NBTTagCompound)t);
+ }
+
+ public boolean isLastOutputFailed() {
+ return lastOutputFailed;
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java
index e1dfc32aba..431241eb84 100644
--- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java
+++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java
@@ -366,7 +366,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
}
private boolean hasValidFluid() {
- return (!GT_Utility.isBlockInvalid(this.mPrimaryPumpedBlock) && !GT_Utility.isBlockInvalid(this.mSecondaryPumpedBlock));
+ return mPrimaryPumpedBlock != null && mSecondaryPumpedBlock != null;
}
private boolean moveOneDown() {
@@ -522,7 +522,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
return;
Block aBlock = getBaseMetaTileEntity().getBlock(aX, aY, aZ);
- if (GT_Utility.isBlockValid(aBlock)) {
+ if (aBlock != null) {
if ((aBlock == Blocks.water) || (aBlock == Blocks.flowing_water)) {
this.mPrimaryPumpedBlock = Blocks.water;
this.mSecondaryPumpedBlock = Blocks.flowing_water;
@@ -549,7 +549,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
Block aBlock = getBaseMetaTileEntity().getBlock(aX, aY, aZ);
- return GT_Utility.isBlockValid(aBlock) &&
+ return aBlock != null &&
(aBlock == Blocks.water ||
aBlock == Blocks.flowing_water ||
aBlock == Blocks.lava ||
@@ -565,7 +565,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
Block aBlock = getBaseMetaTileEntity().getBlock(aX, aY, aZ);
- if ((GT_Utility.isBlockValid(aBlock)) && ((this.mPrimaryPumpedBlock == aBlock) || (this.mSecondaryPumpedBlock == aBlock))) {
+ if (aBlock != null && ((this.mPrimaryPumpedBlock == aBlock) || (this.mSecondaryPumpedBlock == aBlock))) {
boolean isWaterOrLava = ((this.mPrimaryPumpedBlock == Blocks.water || this.mPrimaryPumpedBlock == Blocks.lava));
if (isWaterOrLava && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) != 0) {
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java
index 11430c6862..eba61ad1b1 100644
--- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java
+++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java
@@ -86,7 +86,7 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine {
if (tIndividual != null) {
if (tIndividual.analyze()) {
getFillableStack().amount -= 100;
- this.mOutputItems[0] = GT_Utility.copy(aStack);
+ this.mOutputItems[0] = GT_Utility.copyOrNull(aStack);
aStack.stackSize = 0;
NBTTagCompound tNBT = new NBTTagCompound();
tIndividual.writeToNBT(tNBT);
@@ -97,7 +97,7 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine {
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
return 2;
}
- this.mOutputItems[0] = GT_Utility.copy(aStack);
+ this.mOutputItems[0] = GT_Utility.copyOrNull(aStack);
aStack.stackSize = 0;
this.mMaxProgresstime = 1;
this.mEUt = 1;
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java
index 6cf19d6867..e486596fe6 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java
@@ -190,7 +190,7 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas
++mGlassCount;
} else {
IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(dX, dY, dZ);
- if ((!this.addMaintenanceToMachineList(tTileEntity, 82)) && (!this.addEnergyInputToMachineList(tTileEntity, 82))) {
+ if ((!this.addMaintenanceToMachineList(tTileEntity, 210)) && (!this.addEnergyInputToMachineList(tTileEntity, 210))) {
if (tBlock instanceof ic2.core.block.BlockIC2Door) {
if ((tMeta & 8) == 0) {
// let's not fiddle with bits anymore.
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java
index d7b7e2aa4d..a57a237060 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java
@@ -207,7 +207,7 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_Mu
if (!storedItem.isItemEqual(miningPipe)) continue;
if (pipes == null) {
- setInventorySlotContents(1, GT_Utility.copy(miningPipe));
+ setInventorySlotContents(1, GT_Utility.copyOrNull(miningPipe));
pipes = getStackInSlot(1);
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java
index f1b304a1b1..eab4e9c896 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java
@@ -282,7 +282,7 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn
for (int i = 0; i < limit; i++) {
int absi = INPUT_SLOTS + i;
if (this.mInventory[absi] == null) {
- this.mInventory[absi] = GT_Utility.copy(this.mOutputItems[i]);
+ this.mInventory[absi] = GT_Utility.copyOrNull(this.mOutputItems[i]);
} else if (GT_Utility.areStacksEqual(this.mInventory[absi], this.mOutputItems[i])) {
this.mInventory[absi].stackSize = Math.min(this.mInventory[absi].getMaxStackSize(),
this.mInventory[absi].stackSize + this.mOutputItems[i].stackSize);
diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java
index d78dd722fa..9c8c5faaf9 100644
--- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java
+++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java
@@ -102,7 +102,10 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti
@Optional.Method(modid = "appliedenergistics2")
@Override
public boolean isPrioritized(appeng.api.storage.data.IAEItemStack iaeItemStack) {
- return false;
+ ItemStack s = getItemStack();
+ if (s == null || iaeItemStack == null)
+ return false;
+ return iaeItemStack.isSameType(s);
}
@Optional.Method(modid = "appliedenergistics2")