diff options
Diffstat (limited to 'src/main/java/gregtech/common/tileentities')
68 files changed, 434 insertions, 440 deletions
diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java index 4e80b7b779..73a8fac252 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java @@ -17,8 +17,7 @@ import net.minecraft.item.ItemStack; import java.util.Arrays; import java.util.Comparator; -public class GT_MetaTileEntity_ChestBuffer - extends GT_MetaTileEntity_Buffer { +public class GT_MetaTileEntity_ChestBuffer extends GT_MetaTileEntity_Buffer { private static final int[] tickRate = {400, 200, 100, 20, 4, 1, 1, 1, 1, 1, 1, 1, 1}; @@ -26,7 +25,7 @@ public class GT_MetaTileEntity_ChestBuffer super(aID, aName, aNameRegional, aTier, 28, new String[]{ "Buffers up to 27 Item Stacks", "Use Screwdriver to regulate output stack size", - "Consumes 3EU per moved Item", + "Does not consume energy to move Item", getTickRateDesc(aTier)}); } @@ -69,10 +68,7 @@ public class GT_MetaTileEntity_ChestBuffer if ( (mSuccess <= 0 ) || (mSuccess > 43) || ((mSuccess % 5) == 0 )){ super.moveItems(aBaseMetaTileEntity, aTimer); } - // mSuccesss is set to 50 on a successful move - //if(mSuccess == 50) { - // fillStacksIntoFirstSlots(); - //} + if(mSuccess < 0) { mSuccess = 0; } @@ -110,13 +106,7 @@ public class GT_MetaTileEntity_ChestBuffer id1 = o1.getItemDamage(); id2 = o2.getItemDamage(); - if ( id1 < id2 ) { - return -1; - } - if ( id1 > id2 ) { - return 1; - } - return 0; + return Integer.compare(id1, id2); } }); } diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java index a2f17ef6f3..1f87b45ced 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java @@ -13,8 +13,7 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -public class GT_MetaTileEntity_Filter - extends GT_MetaTileEntity_Buffer { +public class GT_MetaTileEntity_Filter extends GT_MetaTileEntity_Buffer { public boolean bIgnoreNBT = false; public boolean bInvertFilter = false; diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java index da35f17518..84df068972 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java @@ -9,13 +9,12 @@ import gregtech.common.gui.GT_Container_SuperBuffer; import gregtech.common.gui.GT_GUIContainer_SuperBuffer; import net.minecraft.entity.player.InventoryPlayer; -public class GT_MetaTileEntity_SuperBuffer - extends GT_MetaTileEntity_ChestBuffer { +public class GT_MetaTileEntity_SuperBuffer extends GT_MetaTileEntity_ChestBuffer { public GT_MetaTileEntity_SuperBuffer(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 257, new String[]{ "Buffers up to 256 Item Stacks", "Use Screwdriver to regulate output stack size", - "Consumes 1EU per moved Item", + "Does not consume energy to move Item", getTickRateDesc(aTier)}); } diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java index 6292a769a2..ec60dc00e9 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java @@ -16,8 +16,7 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -public class GT_MetaTileEntity_TypeFilter - extends GT_MetaTileEntity_Buffer { +public class GT_MetaTileEntity_TypeFilter extends GT_MetaTileEntity_Buffer { public boolean bNBTAllowed = false; public boolean bInvertFilter = false; public int mRotationIndex = 0; diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java index 4facb0e300..f728d375fa 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java @@ -22,8 +22,7 @@ import net.minecraftforge.fluids.IFluidHandler; import static gregtech.api.objects.XSTR.XSTR_INSTANCE; -public abstract class GT_MetaTileEntity_Boiler - extends GT_MetaTileEntity_BasicTank { +public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTank { public int mTemperature = 20; public int mProcessingEnergy = 0; public int mLossTimer = 0; @@ -48,7 +47,6 @@ public abstract class GT_MetaTileEntity_Boiler public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { ITexture[] tmp = mTextures[aSide >= 2 ? aSide != aFacing ? 2 : ((byte) (aActive ? 4 : 3)) : aSide][aColorIndex + 1]; - //mTextures[(aSide==aFacing?(aActive?4:3):aSide==GT_Utility.getOppositeSide(aFacing)?2:aSide==0?0:aSide==1?1:2)][aColorIndex+1]; if (aSide != aFacing && tmp.length == 2) { tmp = new ITexture[]{tmp[0]}; } @@ -155,7 +153,7 @@ public abstract class GT_MetaTileEntity_Boiler if (this.mSteam != null) { try { aNBT.setTag("mSteam", this.mSteam.writeToNBT(new NBTTagCompound())); - } catch (Throwable e) { + } catch (Throwable ignored) { } } } @@ -257,24 +255,17 @@ public abstract class GT_MetaTileEntity_Boiler } public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - if (GT_Mod.gregtechproxy.mAllowSmallBoilerAutomation) - return true; - else - return false; + return GT_Mod.gregtechproxy.mAllowSmallBoilerAutomation; } public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - if(GT_Mod.gregtechproxy.mAllowSmallBoilerAutomation) - return true; - else - return false; - + return GT_Mod.gregtechproxy.mAllowSmallBoilerAutomation; } public void doSound(byte aIndex, double aX, double aY, double aZ) { if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(4)), 2, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(4), 2, 1.0F, aX, aY, aZ); for (int l = 0; l < 8; l++) { getBaseMetaTileEntity().getWorld().spawnParticle("largesmoke", aX - 0.5D + XSTR_INSTANCE.nextFloat(), aY, aZ - 0.5D + XSTR_INSTANCE.nextFloat(), 0.0D, 0.0D, 0.0D); } diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java index eeb8ec252f..2662d18276 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java @@ -23,10 +23,7 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidHandler; -public class GT_MetaTileEntity_Boiler_Bronze - extends GT_MetaTileEntity_Boiler { - - +public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler { public GT_MetaTileEntity_Boiler_Bronze(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, new String[]{ "An early way to get Steam Power", 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 d6e3d71b81..66b93ea16a 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 @@ -19,8 +19,7 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidHandler; -public class GT_MetaTileEntity_Boiler_Lava - extends GT_MetaTileEntity_Boiler { +public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler { public GT_MetaTileEntity_Boiler_Lava(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, new String[]{ "A Boiler running off Lava", diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java index d7fd69edb2..2c79d507eb 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java @@ -19,8 +19,7 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidHandler; -public class GT_MetaTileEntity_Boiler_Solar - extends GT_MetaTileEntity_Boiler { +public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { public GT_MetaTileEntity_Boiler_Solar(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, new String[0]); } diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java index 5655bb47c5..068e7fd82b 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java @@ -10,8 +10,7 @@ import gregtech.common.gui.GT_Container_Boiler; import gregtech.common.gui.GT_GUIContainer_Boiler; import net.minecraft.entity.player.InventoryPlayer; -public class GT_MetaTileEntity_Boiler_Steel - extends GT_MetaTileEntity_Boiler_Bronze {//TODO CHECK POLLUTION VALUES AND DESCRIPTIONS FOR POLLUTION SPOILERS +public class GT_MetaTileEntity_Boiler_Steel extends GT_MetaTileEntity_Boiler_Bronze { public GT_MetaTileEntity_Boiler_Steel(int aID, String aName, String aNameRegional) { diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java index c745bfae20..debf441bcf 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java @@ -16,8 +16,7 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; -public class GT_MetaTileEntity_DieselGenerator - extends GT_MetaTileEntity_BasicGenerator { +public class GT_MetaTileEntity_DieselGenerator extends GT_MetaTileEntity_BasicGenerator { public static final int BASE_POLLUTION = 2; diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java index ce03f6b505..8bbffcfc6a 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java @@ -10,9 +10,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenera import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; -public class GT_MetaTileEntity_GasTurbine - extends GT_MetaTileEntity_BasicGenerator { - +public class GT_MetaTileEntity_GasTurbine extends GT_MetaTileEntity_BasicGenerator { public static final int BASE_POLLUTION = 1; public int mEfficiency; diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java index eda960bf2b..15014ce8b9 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java @@ -10,13 +10,11 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenera import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; -public class GT_MetaTileEntity_MagicEnergyConverter - extends GT_MetaTileEntity_BasicGenerator { - +public class GT_MetaTileEntity_MagicEnergyConverter extends GT_MetaTileEntity_BasicGenerator { public int mEfficiency; public GT_MetaTileEntity_MagicEnergyConverter(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, "Put your strange stuff in here", new ITexture[0]); + super(aID, aName, aNameRegional, aTier, "Put your strange stuff in here"); onConfigLoad(); } diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java index 52c7e1112c..8442f8a02c 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java @@ -10,13 +10,12 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenera import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; -public class GT_MetaTileEntity_PlasmaGenerator - extends GT_MetaTileEntity_BasicGenerator { +public class GT_MetaTileEntity_PlasmaGenerator extends GT_MetaTileEntity_BasicGenerator { public int mEfficiency; public GT_MetaTileEntity_PlasmaGenerator(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, "Plasma into energy", new ITexture[0]); + super(aID, aName, aNameRegional, aTier, "Plasma into energy"); onConfigLoad(); } diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java index 27ffc096f0..f85b3152bd 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java @@ -8,8 +8,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric; import gregtech.api.objects.GT_RenderedTexture; -public class GT_MetaTileEntity_BasicHull_Bronze - extends GT_MetaTileEntity_BasicHull_NonElectric { +public class GT_MetaTileEntity_BasicHull_Bronze extends GT_MetaTileEntity_BasicHull_NonElectric { public GT_MetaTileEntity_BasicHull_Bronze(int aID, String aName, String aNameRegional, int aTier, String aDescription) { super(aID, aName, aNameRegional, aTier, aDescription); } diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java index 694a701306..7be6ec9a37 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java @@ -8,8 +8,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric; import gregtech.api.objects.GT_RenderedTexture; -public class GT_MetaTileEntity_BasicHull_BronzeBricks - extends GT_MetaTileEntity_BasicHull_NonElectric { +public class GT_MetaTileEntity_BasicHull_BronzeBricks extends GT_MetaTileEntity_BasicHull_NonElectric { public GT_MetaTileEntity_BasicHull_BronzeBricks(int aID, String aName, String aNameRegional, int aTier, String aDescription) { super(aID, aName, aNameRegional, aTier, aDescription); } diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java index d7671e860c..ee9accc566 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java @@ -8,8 +8,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric; import gregtech.api.objects.GT_RenderedTexture; -public class GT_MetaTileEntity_BasicHull_Steel extends GT_MetaTileEntity_BasicHull_NonElectric { - public GT_MetaTileEntity_BasicHull_Steel(int aID, String aName, String aNameRegional, int aTier, String aDescription) { +public class GT_MetaTileEntity_BasicHull_Steel extends GT_MetaTileEntity_BasicHull_NonElectric { public GT_MetaTileEntity_BasicHull_Steel(int aID, String aName, String aNameRegional, int aTier, String aDescription) { super(aID, aName, aNameRegional, aTier, aDescription); } diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java index a86fb19928..0cec1fa4e7 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java @@ -8,8 +8,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric; import gregtech.api.objects.GT_RenderedTexture; -public class GT_MetaTileEntity_BasicHull_SteelBricks - extends GT_MetaTileEntity_BasicHull_NonElectric { +public class GT_MetaTileEntity_BasicHull_SteelBricks extends GT_MetaTileEntity_BasicHull_NonElectric { public GT_MetaTileEntity_BasicHull_SteelBricks(int aID, String aName, String aNameRegional, int aTier, String aDescription) { super(aID, aName, aNameRegional, aTier, aDescription); } 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 new file mode 100644 index 0000000000..38f36ca936 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java @@ -0,0 +1,114 @@ +package gregtech.common.tileentities.machines; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; + +import appeng.api.AEApi; +import appeng.api.networking.GridFlags; +import appeng.api.networking.energy.IEnergySource; +import appeng.api.networking.security.BaseActionSource; +import appeng.api.networking.security.IActionHost; +import appeng.api.networking.security.MachineSource; +import appeng.api.storage.IMEMonitor; +import appeng.api.storage.data.IAEItemStack; +import appeng.api.util.AECableType; +import appeng.me.GridAccessException; +import appeng.me.helpers.AENetworkProxy; +import appeng.me.helpers.IGridProxyable; +import appeng.util.Platform; +import cpw.mods.fml.common.Optional; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; +import gregtech.api.objects.GT_RenderedTexture; + +public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatch_OutputBus { + private BaseActionSource requestSource = null; + private AENetworkProxy gridProxy = null; + + public GT_MetaTileEntity_Hatch_OutputBus_ME(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional, 1, new String[]{ + "Item Output for Multiblocks", "Stores directly into ME"}); + } + + public GT_MetaTileEntity_Hatch_OutputBus_ME(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_OutputBus_ME(mName, mTier, mDescriptionArray, mTextures); + } + + @Override + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ME_HATCH)}; + } + + @Override + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ME_HATCH)}; + } + + @Optional.Method(modid = "appliedenergistics2") + public int store(final ItemStack stack) { + if (stack == null) + return 0; + 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(); + return 0; + } + catch( final GridAccessException ignored ) + { + } + return stack.stackSize; + } + + @Optional.Method(modid = "appliedenergistics2") + private BaseActionSource getRequest() { + if (requestSource == null) + requestSource = new MachineSource((IActionHost)getBaseMetaTileEntity()); + return requestSource; + } + + @Override + @Optional.Method(modid = "appliedenergistics2") + public AECableType getCableConnectionType(ForgeDirection forgeDirection) { + return isOutputFacing((byte)forgeDirection.ordinal()) ? AECableType.SMART : AECableType.NONE; + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + return false; + } + + @Override + @Optional.Method(modid = "appliedenergistics2") + public AENetworkProxy getProxy() { + if (gridProxy == null) { + if (getBaseMetaTileEntity() instanceof IGridProxyable) { + gridProxy = new AENetworkProxy((IGridProxyable)getBaseMetaTileEntity(), "proxy", ItemList.Hatch_Output_Bus_ME.get(1), true); + gridProxy.onReady(); + gridProxy.setFlags(GridFlags.REQUIRE_CHANNEL); + } + } + return this.gridProxy; + } + + @Override + @Optional.Method(modid = "appliedenergistics2") + public void gridChanged() { + } +} diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java index 28f661c339..1db2588ac3 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java @@ -44,14 +44,14 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba 1, // output slot count "Default.png", // GUI name "", // NEI name - new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER) }); + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER)); radius = aRadius; step = aStep; } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java index 6895310b46..d892adabfb 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java @@ -6,21 +6,19 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; -import gregtech.api.objects.GT_ItemStack; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; -public class GT_MetaTileEntity_Boxinator - extends GT_MetaTileEntity_BasicMachine { +public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine { ItemStack aInputCache; ItemStack aOutputCache; int aTypeCache = 0; public GT_MetaTileEntity_Boxinator(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "Puts things into Boxes", 2, 1, "Packager.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_BOXINATOR)}); + super(aID, aName, aNameRegional, aTier, 1, "Puts things into Boxes", 2, 1, "Packager.png", "", new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_BOXINATOR)); } public GT_MetaTileEntity_Boxinator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { @@ -126,6 +124,7 @@ public class GT_MetaTileEntity_Boxinator public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { if (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) { + if (mDisableFilter) return true; ItemStack tInput1 = getInputAt(1); if ((ItemList.Schematic_1by1.isStackEqual(tInput1)) || (ItemList.Schematic_2by2.isStackEqual(tInput1)) || (ItemList.Schematic_3by3.isStackEqual(tInput1))) { if (hasValidCache(aStack,aTypeCache,false)) diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CuringOven.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CuringOven.java index e2663a15e4..11f653f085 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CuringOven.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CuringOven.java @@ -16,11 +16,10 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidStack; -public class GT_MetaTileEntity_CuringOven - extends GT_MetaTileEntity_BasicMachine { +public class GT_MetaTileEntity_CuringOven extends GT_MetaTileEntity_BasicMachine { public GT_MetaTileEntity_CuringOven(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "Heats tools for hardening", 1, 1, "E_Oven.png", "", new ITexture[]{new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_TOP_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_TOP")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_BOTTOM"))}); + super(aID, aName, aNameRegional, aTier, 1, "Heats tools for hardening", 1, 1, "E_Oven.png", "", new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_TOP_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_TOP")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_BOTTOM"))); } public GT_MetaTileEntity_CuringOven(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { @@ -36,7 +35,7 @@ public class GT_MetaTileEntity_CuringOven } public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (ItemList.Cell_Empty.isStackEqual(aStack)); + return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (mDisableFilter || (ItemList.Cell_Empty.isStackEqual(aStack))); } public boolean isFluidInputAllowed(FluidStack aFluid) { diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java index 92ed054b05..9b9442fef2 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java @@ -30,10 +30,9 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; import java.util.stream.IntStream; -public class GT_MetaTileEntity_Disassembler - extends GT_MetaTileEntity_BasicMachine { +public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachine { public GT_MetaTileEntity_Disassembler(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "Disassembles Machines at " + Math.min(50 + 10 * aTier,100) + "% Efficiency", 1, 9, "Disassembler.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_DISASSEMBLER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_DISASSEMBLER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_DISASSEMBLER)}); + super(aID, aName, aNameRegional, aTier, 1, "Disassembles Machines at " + Math.min(50 + 10 * aTier,100) + "% Efficiency", 1, 9, "Disassembler.png", "", new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_DISASSEMBLER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_DISASSEMBLER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_DISASSEMBLER)); } public GT_MetaTileEntity_Disassembler(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { @@ -421,7 +420,6 @@ public class GT_MetaTileEntity_Disassembler } public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return //(aIndex == 4 && GT_Utility.areStacksEqual(aStack, new ItemStack(Items.egg))) || - (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (aStack.getTagCompound() != null) && (aStack.getTagCompound().getCompoundTag("GT.CraftingComponents") != null); + return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (mDisableFilter || (aStack.getTagCompound() != null) && (aStack.getTagCompound().getCompoundTag("GT.CraftingComponents") != null)); } }
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java index 1ffcd3f4f3..745033f4a3 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java @@ -12,15 +12,14 @@ import net.minecraftforge.fluids.FluidStack; import static gregtech.api.enums.GT_Values.V; -public class GT_MetaTileEntity_Massfabricator - extends GT_MetaTileEntity_BasicMachine { +public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMachine { public static int sUUAperUUM = 1; public static int sUUASpeedBonus = 4; public static int sDurationMultiplier = 3215; public static boolean sRequiresUUA = false; public GT_MetaTileEntity_Massfabricator(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "UUM = Matter * Fabrication Squared", 1, 1, "Massfabricator.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB)}); + super(aID, aName, aNameRegional, aTier, 1, "UUM = Matter * Fabrication Squared", 1, 1, "Massfabricator.png", "", new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB)); } public GT_MetaTileEntity_Massfabricator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java index 69543a7196..787c3c0d76 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java @@ -80,7 +80,7 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine { } public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (aStack.getItem() == MINING_PIPE.getItem()); + return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (mDisableFilter || aStack.getItem() == MINING_PIPE.getItem()); } public boolean hasFreeSpace() { diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java index 59b43cbcb2..7341d3cd78 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java @@ -16,10 +16,9 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -public class GT_MetaTileEntity_PotionBrewer - extends GT_MetaTileEntity_BasicMachine { +public class GT_MetaTileEntity_PotionBrewer extends GT_MetaTileEntity_BasicMachine { public GT_MetaTileEntity_PotionBrewer(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "Brewing your Drinks", 1, 0, "PotionBrewer.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_POTIONBREWER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_POTIONBREWER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_POTIONBREWER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_POTIONBREWER)}); + super(aID, aName, aNameRegional, aTier, 1, "Brewing your Drinks", 1, 0, "PotionBrewer.png", "", new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_POTIONBREWER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_POTIONBREWER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_POTIONBREWER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_POTIONBREWER)); } public GT_MetaTileEntity_PotionBrewer(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { @@ -132,7 +131,7 @@ public class GT_MetaTileEntity_PotionBrewer } public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack)); + return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) && (mDisableFilter || getRecipeList().containsInput(aStack)); } public boolean isFluidInputAllowed(FluidStack aFluid) { diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java index 44c39612c6..d478e12099 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java @@ -12,10 +12,9 @@ import net.minecraft.item.ItemStack; import java.util.ArrayList; -public class GT_MetaTileEntity_Printer - extends GT_MetaTileEntity_BasicMachine { +public class GT_MetaTileEntity_Printer extends GT_MetaTileEntity_BasicMachine { public GT_MetaTileEntity_Printer(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "It can copy Books and paint Stuff", 1, 1, "Printer.png", GT_Recipe.GT_Recipe_Map.sPrinterRecipes.mNEIName, new ITexture[0]); + super(aID, aName, aNameRegional, aTier, 1, "It can copy Books and paint Stuff", 1, 1, "Printer.png", GT_Recipe.GT_Recipe_Map.sPrinterRecipes.mNEIName); } public GT_MetaTileEntity_Printer(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { @@ -34,7 +33,7 @@ public class GT_MetaTileEntity_Printer int i = 0; for (int j = tList.size() - 1; i < j; i++) { if (GT_Utility.areStacksEqual(getInputAt(0), (ItemStack) tList.get(i))) { - this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{tList.get(i + 1)}); + this.mOutputItems[0] = GT_Utility.copyAmount(1L, tList.get(i + 1)); calculateOverclockedNess(1,32); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java index 92475d5ae6..151a2cf25b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java @@ -102,7 +102,7 @@ public class GT_MetaTileEntity_Replicator } public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (ItemList.Cell_Empty.isStackEqual(aStack)); + return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) && (mDisableFilter || ItemList.Cell_Empty.isStackEqual(aStack)); } public boolean isFluidInputAllowed(FluidStack aFluid) { diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java index eacaf1703d..932c7a14ec 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java @@ -14,10 +14,9 @@ import gregtech.api.util.GT_Utility; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -public class GT_MetaTileEntity_RockBreaker - extends GT_MetaTileEntity_BasicMachine { +public class GT_MetaTileEntity_RockBreaker extends GT_MetaTileEntity_BasicMachine { public GT_MetaTileEntity_RockBreaker(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "Put Lava and Water adjacent", 1, 1, "RockBreaker.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER)}); + super(aID, aName, aNameRegional, aTier, 1, "Put Lava and Water adjacent", 1, 1, "RockBreaker.png", "", new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER)); } public GT_MetaTileEntity_RockBreaker(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { @@ -37,7 +36,7 @@ public class GT_MetaTileEntity_RockBreaker } public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack)); + return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (mDisableFilter || getRecipeList().containsInput(aStack)); } public int checkRecipe() { @@ -52,7 +51,7 @@ public class GT_MetaTileEntity_RockBreaker if (tOutput != null) { if (GT_Utility.areStacksEqual(getInputAt(0), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L))) { tOutput = new ItemStack(Blocks.obsidian, 1); - if (canOutput(new ItemStack[]{tOutput})) { + if (canOutput(tOutput)) { getInputAt(0).stackSize -= 1; calculateOverclockedNess(32,128); //In case recipe is too OP for that machine @@ -61,7 +60,7 @@ public class GT_MetaTileEntity_RockBreaker this.mOutputItems[0] = tOutput; return 2; } - } else if (canOutput(new ItemStack[]{tOutput})) { + } else if (canOutput(tOutput)) { calculateOverclockedNess(32,16); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) 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 1d627e3878..3e4a0846b5 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 @@ -31,11 +31,10 @@ import net.minecraft.nbt.NBTTagString; import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes; -public class GT_MetaTileEntity_Scanner - extends GT_MetaTileEntity_BasicMachine { +public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { public GT_MetaTileEntity_Scanner(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "Scans Crops and other things.", 1, 1, "Scanner.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_SCANNER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_SCANNER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_SCANNER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_SCANNER)}); + super(aID, aName, aNameRegional, aTier, 1, "Scans Crops and other things.", 1, 1, "Scanner.png", "", new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_SCANNER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_SCANNER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_SCANNER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_SCANNER)); } public GT_MetaTileEntity_Scanner(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { @@ -57,14 +56,14 @@ public class GT_MetaTileEntity_Scanner } else if ((GT_Utility.isStackValid(aStack)) && (aStack.stackSize > 0)) { if ((getFillableStack() != null) && (getFillableStack().containsFluid(Materials.Honey.getFluid(100L)))) { try { - Object tIndividual = AlleleManager.alleleRegistry.getIndividual(aStack); + IIndividual tIndividual = AlleleManager.alleleRegistry.getIndividual(aStack); if (tIndividual != null) { - if (((IIndividual) tIndividual).analyze()) { + if (tIndividual.analyze()) { getFillableStack().amount -= 100; - this.mOutputItems[0] = GT_Utility.copy(new Object[]{aStack}); + this.mOutputItems[0] = GT_Utility.copy(aStack); aStack.stackSize = 0; NBTTagCompound tNBT = new NBTTagCompound(); - ((IIndividual) tIndividual).writeToNBT(tNBT); + tIndividual.writeToNBT(tNBT); this.mOutputItems[0].setTagCompound(tNBT); calculateOverclockedNess(2, 500); //In case recipe is too OP for that machine @@ -72,7 +71,7 @@ public class GT_MetaTileEntity_Scanner return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; return 2; } - this.mOutputItems[0] = GT_Utility.copy(new Object[]{aStack}); + this.mOutputItems[0] = GT_Utility.copy(aStack); aStack.stackSize = 0; this.mMaxProgresstime = 1; this.mEUt = 1; @@ -100,14 +99,14 @@ public class GT_MetaTileEntity_Scanner this.mEUt = 1; } aStack.stackSize -= 1; - this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{aStack}); + this.mOutputItems[0] = GT_Utility.copyAmount(1L, aStack); this.mOutputItems[0].setTagCompound(tNBT); return 2; } if (ItemList.Tool_DataOrb.isStackEqual(getSpecialSlot(), false, true)) { if (ItemList.Tool_DataOrb.isStackEqual(aStack, false, true)) { aStack.stackSize -= 1; - this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); + this.mOutputItems[0] = GT_Utility.copyAmount(1L, getSpecialSlot()); calculateOverclockedNess(30, 512); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) @@ -119,7 +118,7 @@ public class GT_MetaTileEntity_Scanner getSpecialSlot().stackSize -= 1; aStack.stackSize -= 1; - this.mOutputItems[0] = ItemList.Tool_DataOrb.get(1L, new Object[0]); + this.mOutputItems[0] = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(this.mOutputItems[0], "Elemental-Scan"); Behaviour_DataOrb.setDataName(this.mOutputItems[0], tData.mMaterial.mMaterial.mElement.name()); calculateOverclockedNess(30, GT_Utility.safeInt(tData.mMaterial.mMaterial.getMass() * 8192L)); @@ -132,7 +131,7 @@ public class GT_MetaTileEntity_Scanner if (ItemList.Tool_DataStick.isStackEqual(getSpecialSlot(), false, true)) { if (ItemList.Tool_DataStick.isStackEqual(aStack, false, true)) { aStack.stackSize -= 1; - this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); + this.mOutputItems[0] = GT_Utility.copyAmount(1L, getSpecialSlot()); calculateOverclockedNess(30, 128); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) @@ -143,7 +142,7 @@ public class GT_MetaTileEntity_Scanner getSpecialSlot().stackSize -= 1; aStack.stackSize -= 1; - this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); + this.mOutputItems[0] = GT_Utility.copyAmount(1L, getSpecialSlot()); this.mOutputItems[0].setTagCompound(aStack.getTagCompound()); calculateOverclockedNess(30, 128); //In case recipe is too OP for that machine @@ -155,7 +154,7 @@ public class GT_MetaTileEntity_Scanner getSpecialSlot().stackSize -= 1; aStack.stackSize -= 1; - this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); + this.mOutputItems[0] = GT_Utility.copyAmount(1L, getSpecialSlot()); this.mOutputItems[0].setTagCompound(GT_Utility.getNBTContainingShort(new NBTTagCompound(), "map_id", (short) aStack.getItemDamage())); calculateOverclockedNess(30, 128); //In case recipe is too OP for that machine @@ -189,7 +188,7 @@ public class GT_MetaTileEntity_Scanner getSpecialSlot().stackSize -= 1; aStack.stackSize -= 1; - this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); + this.mOutputItems[0] = GT_Utility.copyAmount(1L, getSpecialSlot()); this.mOutputItems[0].setTagCompound(GT_Utility.getNBTContainingShort(new NBTTagCompound(), "rocket_tier", Short.parseShort(sTier))); calculateOverclockedNess(480, 36000); @@ -206,7 +205,7 @@ public class GT_MetaTileEntity_Scanner GT_Utility.ItemNBT.convertProspectionData(aStack); aStack.stackSize -= 1; - this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{aStack}); + this.mOutputItems[0] = GT_Utility.copyAmount(1L, aStack); calculateOverclockedNess(30, 1000); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) @@ -235,7 +234,7 @@ public class GT_MetaTileEntity_Scanner if (s == null) s = tRecipe.mOutput.getDisplayName(); } - this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); + this.mOutputItems[0] = GT_Utility.copyAmount(1L, getSpecialSlot()); //remove possible old NBTTagCompound this.mOutputItems[0].setTagCompound(new NBTTagCompound()); GT_Utility.ItemNBT.setBookTitle(this.mOutputItems[0], s + " Construction Data"); @@ -285,7 +284,7 @@ public class GT_MetaTileEntity_Scanner } - tBuilder.append((count == 0 ? "" : "\nOr ") + tStack.stackSize + " " + s); + tBuilder.append(count == 0 ? "" : "\nOr ").append(tStack.stackSize).append(" ").append(s); count++; } } @@ -350,13 +349,13 @@ public class GT_MetaTileEntity_Scanner } public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack)); + return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (mDisableFilter || getRecipeList().containsInput(aStack)); } public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(212)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(212), 10, 1.0F, aX, aY, aZ); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java index 3c5dffeb9f..ac7dd17607 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java @@ -32,7 +32,7 @@ public class GT_MetaTileEntity_SeismicProspector extends GT_MetaTileEntity_Basic boolean ready = false; public GT_MetaTileEntity_SeismicProspector(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "(DEPRECATED, DO NOT USE! SWAP TO ADVANCED VERSION USING SHAPELESS RECIPE!)", 1, 1, "Default.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER)}); + super(aID, aName, aNameRegional, aTier, 1, "(DEPRECATED, DO NOT USE! SWAP TO ADVANCED VERSION USING SHAPELESS RECIPE!)", 1, 1, "Default.png", "", new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER)); } public GT_MetaTileEntity_SeismicProspector(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { diff --git a/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineBase.java b/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineBase.java index faf27ca0f1..72d6650154 100644 --- a/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineBase.java @@ -240,7 +240,7 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta @Override public void onMachineBlockUpdate() { - GT_Mod.GT_FML_LOGGER.info("You're dead to me"); + //GT_Mod.GT_FML_LOGGER.info("You're dead to me"); mTargetPos = null; mSender = null; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java index af388a790d..3d4dcf5652 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java @@ -8,8 +8,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.objects.GT_RenderedTexture; import net.minecraft.block.Block; -public class GT_MetaTileEntity_BronzeBlastFurnace - extends GT_MetaTileEntity_PrimitiveBlastFurnace { +public class GT_MetaTileEntity_BronzeBlastFurnace extends GT_MetaTileEntity_PrimitiveBlastFurnace { private static final ITexture[] FACING_SIDE = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS)}; private static final ITexture[] FACING_FRONT = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE)}; private static final ITexture[] FACING_ACTIVE = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_ACTIVE)}; @@ -28,12 +27,6 @@ public class GT_MetaTileEntity_BronzeBlastFurnace public String[] getDescription() { return new String[]{"Disabled"}; - /*return new String[]{ - "Controller Block for the Bronze Blast Furnace", - "Useable for Steel and general Pyrometallurgy", - "Size(WxHxD): 3x4x3 (Hollow, with opening on top)", - "Built from 32 Bronze Plated Bricks", - "Causes 200 Pollution per second"};*/ } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { 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 0ca2cb8a6c..962fa54bf3 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 @@ -60,6 +60,7 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas .addStructureInfo("1x Reinforced Door (keep closed or efficiency will reduce)") .addStructureInfo("Up to 10 Machine Hulls for Item & Energy transfer through walls") .addStructureInfo("You can also use Diodes for more power") + .addStructureInfo("Diodes also count towards 10 Machine Hulls count limit") .toolTipFinisher("Gregtech"); if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { return tt.getInformation(); @@ -72,7 +73,7 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas public boolean checkRecipe(ItemStack aStack) { mEfficiencyIncrease = 100; // use the standard overclock mechanism to determine duration and estimate a maximum consumption - calculateOverclockedNessMulti(40, 45 * Math.min(1, mHeight - 1), 1, getMaxInputVoltage()); + calculateOverclockedNessMulti(40, 45 * Math.max(1, mHeight - 1), 1, getMaxInputVoltage()); // negate it to trigger the special energy consumption function. divide by 10 to get the actual final consumption. mEUt /= -10; return true; @@ -188,10 +189,12 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas if ((!this.addMaintenanceToMachineList(tTileEntity, 82)) && (!this.addEnergyInputToMachineList(tTileEntity, 82))) { if (tBlock instanceof ic2.core.block.BlockIC2Door) { if ((tMeta & 8) == 0) { - if (Math.abs(dY) < y) //x - side - doorState = (tMeta & 0x5) == 0x4 || (tMeta & 0x5) == 0x1; - else if (Math.abs(dX) < x) //y-side, corners ignored. - doorState = (tMeta & 0x5) == 0x5 || (tMeta & 0x5) == 0x0; + // let's not fiddle with bits anymore. + if (Math.abs(dZ) < z) // on side parallel to z axis + doorState = tMeta == 1 || tMeta == 3 || tMeta == 4 || tMeta == 6; + else if (Math.abs(dX) < x) // on side parallel to x axis + doorState = tMeta == 0 || tMeta == 2 || tMeta == 5 || tMeta == 7; + // corners ignored } mDoorCount++; } else { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java index 12ab91d876..26319d43f2 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java @@ -18,13 +18,11 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; +import org.lwjgl.input.Keyboard; import java.util.ArrayList; -import org.lwjgl.input.Keyboard; - -public class GT_MetaTileEntity_DistillationTower - extends GT_MetaTileEntity_MultiBlockBase { +public class GT_MetaTileEntity_DistillationTower extends GT_MetaTileEntity_MultiBlockBase { private static final int CASING_INDEX = 49; private short controllerY; @@ -106,25 +104,25 @@ public class GT_MetaTileEntity_DistillationTower byte tTier = (byte) Math.max(0, GT_Utility.getTier(tVoltage)); FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); if (tFluids.length > 0) { - for(int i = 0;i<tFluids.length;i++){ - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[]{tFluids[i]}, new ItemStack[]{}); - if (tRecipe != null) { - if (tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[]{})) { - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); + for (FluidStack tFluid : tFluids) { + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[]{tFluid}); + if (tRecipe != null) { + if (tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[]{})) { + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)}; + this.mOutputFluids = tRecipe.mFluidOutputs.clone(); + updateSlots(); + return true; } - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)}; - this.mOutputFluids = tRecipe.mFluidOutputs.clone(); - updateSlots(); - return true; - } } } } 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 b480f4f5a6..68770644de 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 @@ -168,10 +168,14 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_Mu case 2: return 3; } - if (!GT_Utility.setBlockByFakePlayer(getFakePlayer(getBaseMetaTileEntity()), xPipe, yHead - 1, zPipe, miningPipeTipBlock, 0, isSimulating)) return 3; + Block b = getBaseMetaTileEntity().getBlock(xPipe, yHead - 1, zPipe); + if (b != miningPipeTipBlock && !GT_Utility.setBlockByFakePlayer(getFakePlayer(getBaseMetaTileEntity()), xPipe, yHead - 1, zPipe, miningPipeTipBlock, 0, isSimulating)) + return 3; if (!isSimulating) { - if (yHead != yDrill) getBaseMetaTileEntity().getWorld().setBlock(xPipe, yHead, zPipe, miningPipeBlock); - getBaseMetaTileEntity().decrStackSize(1, 1); + if (yHead != yDrill) + getBaseMetaTileEntity().getWorld().setBlock(xPipe, yHead, zPipe, miningPipeBlock); + if (b != miningPipeBlock && b != miningPipeTipBlock) + getBaseMetaTileEntity().decrStackSize(1, 1); } return 0; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java index 488703d2b5..e83ab1a699 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java @@ -29,8 +29,7 @@ import org.lwjgl.input.Keyboard; import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.GT_Values.VN; -public class GT_MetaTileEntity_ElectricBlastFurnace - extends GT_MetaTileEntity_AbstractMultiFurnace { +public class GT_MetaTileEntity_ElectricBlastFurnace extends GT_MetaTileEntity_AbstractMultiFurnace { private int mHeatingCapacity = 0; private int controllerY; private FluidStack[] pollutionFluidStacks = new FluidStack[]{Materials.CarbonDioxide.getGas(1000), diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java index e1db9d54f6..62b6feacc7 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java @@ -1,7 +1,5 @@ package gregtech.common.tileentities.machines.multi; -import java.util.ArrayList; - import gregtech.GT_Mod; import gregtech.api.enums.Dyes; import gregtech.api.enums.GT_Values; @@ -30,6 +28,8 @@ import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; +import java.util.ArrayList; + public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity_MultiBlockBase { public GT_Recipe mLastRecipe; @@ -110,18 +110,18 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity && (addIfInjector(xCenter - 6, yCenter - 1, zCenter - 1, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 6, yCenter - 1, zCenter - 1, aBaseMetaTileEntity)) && (this.mEnergyHatches.size() >= 1) && (this.mOutputHatches.size() >= 1) && (this.mInputHatches.size() >= 2)) { int mEnergyHatches_sS = this.mEnergyHatches.size(); - for (int i = 0; i < mEnergyHatches_sS; i++) { - if (this.mEnergyHatches.get(i).mTier < tier()) + for (GT_MetaTileEntity_Hatch_Energy mEnergyHatch : this.mEnergyHatches) { + if (mEnergyHatch.mTier < tier()) return false; } int mOutputHatches_sS = this.mOutputHatches.size(); - for (int i = 0; i < mOutputHatches_sS; i++) { - if (this.mOutputHatches.get(i).mTier < tier()) + for (GT_MetaTileEntity_Hatch_Output mOutputHatch : this.mOutputHatches) { + if (mOutputHatch.mTier < tier()) return false; } int mInputHatches_sS = this.mInputHatches.size(); - for (int i = 0; i < mInputHatches_sS; i++) { - if (this.mInputHatches.get(i).mTier < tier()) + for (GT_MetaTileEntity_Hatch_Input mInputHatch : this.mInputHatches) { + if (mInputHatch.mTier < tier()) return false; } mWrench = true; @@ -138,8 +138,8 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity private boolean checkTier(byte tier, ArrayList<GT_MetaTileEntity_Hatch> list) { if (list != null) { int list_sS=list.size(); - for (int i = 0; i < list_sS; i++) { - if (list.get(i).mTier < tier) { + for (GT_MetaTileEntity_Hatch gt_metaTileEntity_hatch : list) { + if (gt_metaTileEntity_hatch.mTier < tier) { return false; } } @@ -272,13 +272,13 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity } if (tFluidList.size() > 1) { FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sFusionRecipes.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, GT_Values.V[8], tFluids, new ItemStack[]{}); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sFusionRecipes.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, GT_Values.V[8], tFluids); if ((tRecipe == null && !mRunningOnLoad) || (maxEUStore() < tRecipe.mSpecialValue)) { turnCasingActive(false); this.mLastRecipe = null; return false; } - if (mRunningOnLoad || tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[]{})) { + if (mRunningOnLoad || tRecipe.isRecipeInputEqual(true, tFluids)) { this.mLastRecipe = tRecipe; this.mEUt = (this.mLastRecipe.mEUt * overclock(this.mLastRecipe.mSpecialValue)); this.mMaxProgresstime = this.mLastRecipe.mDuration / overclock(this.mLastRecipe.mSpecialValue); @@ -362,8 +362,8 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity mEfficiencyIncrease = 0; if (mOutputFluids != null && mOutputFluids.length > 0) { try { - GT_Mod.instance.achievements.issueAchivementHatchFluid(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), mOutputFluids[0]); - } catch (Exception e) { + GT_Mod.achievements.issueAchivementHatchFluid(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), mOutputFluids[0]); + } catch (Exception ignored) { } } this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU(); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java index dfa58c6407..2d01b0a788 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java @@ -239,10 +239,7 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBloc } public boolean ignoreController(Block tTileEntity) { - if (!controller && tTileEntity == GregTech_API.sBlockMachines) { - return true; - } - return false; + return !controller && tTileEntity == GregTech_API.sBlockMachines; } public boolean addColdFluidOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java index 9e002badbf..832374f4de 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java @@ -15,13 +15,11 @@ import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; +import org.lwjgl.input.Keyboard; import java.util.ArrayList; -import org.lwjgl.input.Keyboard; - -public class GT_MetaTileEntity_ImplosionCompressor - extends GT_MetaTileEntity_MultiBlockBase { +public class GT_MetaTileEntity_ImplosionCompressor extends GT_MetaTileEntity_MultiBlockBase { public GT_MetaTileEntity_ImplosionCompressor(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -122,7 +120,7 @@ public class GT_MetaTileEntity_ImplosionCompressor public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 20) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(5)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java index 551abdf38a..e80f3dfb39 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java @@ -9,19 +9,22 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.*; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; +import org.lwjgl.input.Keyboard; import java.util.ArrayList; -import org.lwjgl.input.Keyboard; - -public abstract class GT_MetaTileEntity_LargeBoiler - extends GT_MetaTileEntity_MultiBlockBase { +public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_MultiBlockBase { private boolean firstRun = true; private int mSuperEfficencyIncrease = 0; private int integratedCircuitConfig = 0; //Steam output is reduced by 1000L per config diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java index c44f47f726..58bb33669e 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java @@ -5,8 +5,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; -public class GT_MetaTileEntity_LargeBoiler_Bronze - extends GT_MetaTileEntity_LargeBoiler { +public class GT_MetaTileEntity_LargeBoiler_Bronze extends GT_MetaTileEntity_LargeBoiler { public GT_MetaTileEntity_LargeBoiler_Bronze(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java index 12a08a858d..5464d31727 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java @@ -5,8 +5,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; -public class GT_MetaTileEntity_LargeBoiler_Steel - extends GT_MetaTileEntity_LargeBoiler { +public class GT_MetaTileEntity_LargeBoiler_Steel extends GT_MetaTileEntity_LargeBoiler { public GT_MetaTileEntity_LargeBoiler_Steel(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java index c0a06168ab..d8e0f79276 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java @@ -5,8 +5,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; -public class GT_MetaTileEntity_LargeBoiler_Titanium - extends GT_MetaTileEntity_LargeBoiler { +public class GT_MetaTileEntity_LargeBoiler_Titanium extends GT_MetaTileEntity_LargeBoiler { public GT_MetaTileEntity_LargeBoiler_Titanium(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java index 629733ad9d..f1e7b833ea 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java @@ -5,8 +5,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; -public class GT_MetaTileEntity_LargeBoiler_TungstenSteel - extends GT_MetaTileEntity_LargeBoiler { +public class GT_MetaTileEntity_LargeBoiler_TungstenSteel extends GT_MetaTileEntity_LargeBoiler { public GT_MetaTileEntity_LargeBoiler_TungstenSteel(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java index 8d4d81a5d2..de2da43e89 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java @@ -1,7 +1,5 @@ package gregtech.common.tileentities.machines.multi; -import java.util.ArrayList; - import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.GT_MetaGenerated_Tool; @@ -19,6 +17,8 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; +import java.util.ArrayList; + public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_MultiBlockBase { protected int baseEff = 0; @@ -175,15 +175,6 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_M this.mMaxProgresstime = 1; this.mEfficiencyIncrease = 10; // Overvoltage is handled inside the MultiBlockBase when pushing out to dynamos. no need to do it here. - /* - if(this.mDynamoHatches.size()>0){ - for(GT_MetaTileEntity_Hatch dynamo:mDynamoHatches) - if(isValidMetaTileEntity(dynamo) && dynamo.maxEUOutput() < mEUt) { - GT_Log.exp.println("Turbine "+this.mName+" DynHatch Explosion!"); - explodeMultiblock(); - } - } - */ return true; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java index 6c482db6e7..91bc7496a4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java @@ -1,10 +1,5 @@ package gregtech.common.tileentities.machines.multi; -import java.util.ArrayList; -import java.util.Collection; - -import org.lwjgl.input.Keyboard; - import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -18,6 +13,10 @@ import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import org.lwjgl.input.Keyboard; + +import java.util.ArrayList; +import java.util.Collection; public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeTurbine { @@ -118,12 +117,11 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT int totalFlow = 0; storedFluid=0; - int aFluids_sS=aFluids.size(); - for (int i = 0; i < aFluids_sS; i++) { - if (aFluids.get(i).isFluidEqual(firstFuelType)) { - flow = Math.min(aFluids.get(i).amount, remainingFlow); // try to use up to 125% of optimal flow w/o exceeding remainingFlow - depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount - this.storedFluid += aFluids.get(i).amount; + for (FluidStack aFluid : aFluids) { + if (aFluid.isFluidEqual(firstFuelType)) { + flow = Math.min(aFluid.amount, remainingFlow); // try to use up to 125% of optimal flow w/o exceeding remainingFlow + depleteInput(new FluidStack(aFluid, flow)); // deplete that amount + this.storedFluid += aFluid.amount; remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches totalFlow += flow; // track total input used } @@ -133,9 +131,6 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT if (totalFlow != actualOptimalFlow) { float efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow) / (float)actualOptimalFlow); - //if(totalFlow>actualOptimalFlow){efficiency = 1.0f;} - //if (efficiency < 0) - // efficiency = 0; // Can happen with really ludicrously poor inefficiency. tEU *= efficiency; tEU = GT_Utility.safeInt((long)tEU * (long)aBaseEff / 10000L); } else { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java index d4e793346f..ef894f29dc 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java @@ -120,7 +120,7 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La if (!achievement) { try { GT_Mod.instance.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "efficientsteam"); - } catch (Exception e) { + } catch (Exception ignored) { } achievement = true; } @@ -163,53 +163,7 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La super.looseFit = looseFit; return super.getInfoData(); } - /* - * moved to super - * - int mPollutionReduction=0; - for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { - if (isValidMetaTileEntity(tHatch)) { - mPollutionReduction=Math.max(tHatch.calculatePollutionReduction(100),mPollutionReduction); - } - } - - String tRunning = mMaxProgresstime>0 ? - EnumChatFormatting.GREEN+"Turbine running"+EnumChatFormatting.RESET : - EnumChatFormatting.RED+"Turbine stopped"+EnumChatFormatting.RESET; - String tMaintainance = getIdealStatus() == getRepairStatus() ? - EnumChatFormatting.GREEN+"No Maintainance issues"+EnumChatFormatting.RESET : - EnumChatFormatting.RED+"Needs Maintainance"+EnumChatFormatting.RESET ; - int tDura = 0; - - if (mInventory[1] != null && mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) { - tDura = GT_Utility.safeInt((long)(100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(mInventory[1]) * (GT_MetaGenerated_Tool.getToolDamage(mInventory[1]))+1)); - } - long storedEnergy=0; - long maxEnergy=0; - for(GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) { - if (isValidMetaTileEntity(tHatch)) { - storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU(); - maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity(); - } - } - - return new String[]{ - // 8 Lines available for information panels - tRunning + ": " + EnumChatFormatting.RED+mEUt+EnumChatFormatting.RESET+" EU/t", // 1 - tMaintainance, // 2 - "Current Speed: "+EnumChatFormatting.YELLOW+(mEfficiency/100F)+EnumChatFormatting.RESET+"%", // 2 - "Stored Energy:" + EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+ // 3 - EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU", - "Optimal Flow: "+EnumChatFormatting.YELLOW+GT_Utility.safeInt((long)realOptFlow)+EnumChatFormatting.RESET+" L/t" + // 4 - EnumChatFormatting.YELLOW+"("+(looseFit?"Loose":"Tight")+")", // 5 - "Fuel Remaining: "+EnumChatFormatting.GOLD+storedFluid+EnumChatFormatting.RESET+"L", // 6 - "Turbine Damage: "+EnumChatFormatting.RED+Integer.toString(tDura)+EnumChatFormatting.RESET+"%", // 7 - "Pollution reduced to: "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %" // 8 - }; - } - */ - @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java index bb5134097a..7749cde34d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java @@ -1,10 +1,5 @@ package gregtech.common.tileentities.machines.multi; -import java.util.ArrayList; -import java.util.Collection; - -import org.lwjgl.input.Keyboard; - import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -20,6 +15,10 @@ import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; +import org.lwjgl.input.Keyboard; + +import java.util.ArrayList; +import java.util.Collection; public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_LargeTurbine { @@ -111,12 +110,11 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar int totalFlow = 0; storedFluid=0; - int aFluids_sS=aFluids.size(); - for (int i = 0; i < aFluids_sS; i++) { - if (aFluids.get(i).isFluidEqual(firstFuelType)) { - flow = Math.min(aFluids.get(i).amount, remainingFlow); // try to use up w/o exceeding remainingFlow - depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount - this.storedFluid += aFluids.get(i).amount; + for (FluidStack aFluid : aFluids) { + if (aFluid.isFluidEqual(firstFuelType)) { + flow = Math.min(aFluid.amount, remainingFlow); // try to use up w/o exceeding remainingFlow + depleteInput(new FluidStack(aFluid, flow)); // deplete that amount + this.storedFluid += aFluid.amount; remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches totalFlow += flow; // track total input used } @@ -140,9 +138,7 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar if (totalFlow != actualOptimalFlow) { double efficiency = 1.0D - Math.abs((totalFlow - actualOptimalFlow) / (float)actualOptimalFlow); - //if(totalFlow>actualOptimalFlow){efficiency = 1.0f;} - //if (efficiency < 0) - // efficiency = 0; // Can happen with really ludicrously poor inefficiency. + tEU = (int)(tEU * efficiency); tEU = GT_Utility.safeInt((long)(aBaseEff/10000D*tEU)); } else { @@ -204,57 +200,8 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar this.mMaxProgresstime = 20; this.mEfficiencyIncrease = 200; // Overvoltage is handled inside the MultiBlockBase when pushing out to dynamos. no need to do it here. - /* - if(this.mDynamoHatches.size()>0){ - for(GT_MetaTileEntity_Hatch dynamo:mDynamoHatches) - if(isValidMetaTileEntity(dynamo) && dynamo.maxEUOutput() < mEUt) { - GT_Log.exp.println("Turbine "+this.mName+" DynHatch Explosion!"); - explodeMultiblock(); - } - } - */ + return true; } } - - /* - * moved to super - * - * @Override - public String[] getInfoData() { - String tRunning = mMaxProgresstime>0 ? - EnumChatFormatting.GREEN+"Turbine running"+EnumChatFormatting.RESET : - EnumChatFormatting.RED+"Turbine stopped"+EnumChatFormatting.RESET; - String tMaintainance = getIdealStatus() == getRepairStatus() ? - EnumChatFormatting.GREEN+"No Maintainance issues"+EnumChatFormatting.RESET : - EnumChatFormatting.RED+"Needs Maintainance"+EnumChatFormatting.RESET ; - int tDura = 0; - - if (mInventory[1] != null && mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) { - tDura = GT_Utility.safeInt((long)(100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(mInventory[1]) * (GT_MetaGenerated_Tool.getToolDamage(mInventory[1]))+1)); - } - - long storedEnergy=0; - long maxEnergy=0; - for(GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) { - if (isValidMetaTileEntity(tHatch)) { - storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU(); - maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity(); - } - } - - return new String[]{ - EnumChatFormatting.BLUE+"Large Turbine"+EnumChatFormatting.RESET, - "Stored Energy:", - EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+ - EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU", - tRunning, - "Current Output: "+EnumChatFormatting.RED+mEUt+EnumChatFormatting.RESET+" EU/t", - "Optimal Flow: "+EnumChatFormatting.YELLOW+GT_Utility.safeInt((long)realOptFlow)+EnumChatFormatting.RESET+" L/s", - "Fuel Remaining: "+EnumChatFormatting.GOLD+storedFluid+EnumChatFormatting.RESET+"L", - "Current Speed: "+EnumChatFormatting.YELLOW+(mEfficiency/100F)+EnumChatFormatting.RESET+"%", - "Turbine Damage: "+EnumChatFormatting.RED+Integer.toString(tDura)+EnumChatFormatting.RESET+"%", - tMaintainance, - }; - }*/ } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java index b50ff52ddd..306dfe734d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java @@ -169,51 +169,6 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg super.looseFit = looseFit; return super.getInfoData(); } - /* - int mPollutionReduction=0; - for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { - if (isValidMetaTileEntity(tHatch)) { - mPollutionReduction=Math.max(tHatch.calculatePollutionReduction(100),mPollutionReduction); - } - } - - String tRunning = mMaxProgresstime>0 ? - EnumChatFormatting.GREEN+"Turbine running"+EnumChatFormatting.RESET : - EnumChatFormatting.RED+"Turbine stopped"+EnumChatFormatting.RESET; - String tMaintainance = getIdealStatus() == getRepairStatus() ? - EnumChatFormatting.GREEN+"No Maintainance issues"+EnumChatFormatting.RESET : - EnumChatFormatting.RED+"Needs Maintainance"+EnumChatFormatting.RESET ; - int tDura = 0; - - if (mInventory[1] != null && mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) { - tDura = GT_Utility.safeInt((long)(100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(mInventory[1]) * (GT_MetaGenerated_Tool.getToolDamage(mInventory[1]))+1)); - } - - long storedEnergy=0; - long maxEnergy=0; - for(GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) { - if (isValidMetaTileEntity(tHatch)) { - storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU(); - maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity(); - } - } - - return new String[]{ - // 8 Lines available for information panels - tRunning + ": " + EnumChatFormatting.RED+mEUt+EnumChatFormatting.RESET+" EU/t", // 1 - tMaintainance, // 2 - "Current Speed: "+EnumChatFormatting.YELLOW+(mEfficiency/100F)+EnumChatFormatting.RESET+"%", // 2 - "Stored Energy:" + EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+ // 3 - EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU", - "Optimal Flow: "+EnumChatFormatting.YELLOW+GT_Utility.safeInt((long)realOptFlow)+EnumChatFormatting.RESET+" L/t" + // 4 - EnumChatFormatting.YELLOW+" ("+(looseFit?"Loose":"Tight")+")", // 5 - "Fuel Remaining: "+EnumChatFormatting.GOLD+storedFluid+EnumChatFormatting.RESET+"L", // 6 - "Turbine Damage: "+EnumChatFormatting.RED+Integer.toString(tDura)+EnumChatFormatting.RESET+"%", // 7 - "Pollution reduced to: "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %" // 8 - }; - } - - */ @Override public void saveNBTData(NBTTagCompound aNBT) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java index 8b27932511..bc85ed97cc 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java @@ -27,8 +27,7 @@ import java.util.ArrayList; import static gregtech.api.enums.GT_Values.VN; -public class GT_MetaTileEntity_MultiFurnace - extends GT_MetaTileEntity_AbstractMultiFurnace { +public class GT_MetaTileEntity_MultiFurnace extends GT_MetaTileEntity_AbstractMultiFurnace { private int mLevel = 0; private int mCostDiscount = 1; @@ -110,12 +109,7 @@ public class GT_MetaTileEntity_MultiFurnace tCurrenParrallel = tMaxParrallel; break; } -// this.mOutputItems = new ItemStack[8 * this.mLevel]; -// for (int i = 0; (i < 256) && (j < this.mOutputItems.length); i++) { -// if (null != (this.mOutputItems[j] = GT_ModHandler.getSmeltingOutput((ItemStack) tInputList.get(i % tInputList.size()), true, null))) { -// j++; -// } -// } + tCurrenParrallel *= tOutputStack.stackSize; this.mOutputItems = new ItemStack[(tCurrenParrallel/64)+1]; for (int i = 0; i < this.mOutputItems.length; i++) { 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 eeeef95dc3..225cd24e3e 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 @@ -18,6 +18,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.ChunkPosition; import net.minecraftforge.common.util.ForgeDirection; +import org.lwjgl.input.Keyboard; import static gregtech.api.objects.XSTR.XSTR_INSTANCE; @@ -317,4 +318,9 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn } public abstract String getName(); + + @Override + public boolean isDisplaySecondaryDescription() { + return Keyboard.isKeyDown(Keyboard.KEY_LSHIFT); + } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java index 2496d02a42..1fdc698fe4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java @@ -276,15 +276,13 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl } tOut = clean(tOut); this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - List<ItemStack> overStacks = new ArrayList<ItemStack>(); - for (int f = 0; f < tOut.length; f++) { - while (tOut[f].getMaxStackSize() < tOut[f].stackSize) { - if (tOut[f] != null) { - ItemStack tmp = tOut[f].copy(); - tmp.stackSize = tmp.getMaxStackSize(); - tOut[f].stackSize = tOut[f].stackSize - tOut[f].getMaxStackSize(); - overStacks.add(tmp); - } + List<ItemStack> overStacks = new ArrayList<>(); + for (ItemStack itemStack : tOut) { + while (itemStack != null && itemStack.getMaxStackSize() < itemStack.stackSize) { + ItemStack tmp = itemStack.copy(); + tmp.stackSize = tmp.getMaxStackSize(); + itemStack.stackSize = itemStack.stackSize - itemStack.getMaxStackSize(); + overStacks.add(tmp); } } if (overStacks.size() > 0) { @@ -301,9 +299,7 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl this.mOutputFluids = new FluidStack[]{tFOut}; updateSlots(); return true; - }/* else{ - ...remoteRecipeCheck() - }*/ + } } return false; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java index bf4b1e9db7..6f00bcb0c6 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java @@ -14,13 +14,11 @@ import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; +import org.lwjgl.input.Keyboard; import java.util.ArrayList; -import org.lwjgl.input.Keyboard; - -public class GT_MetaTileEntity_VacuumFreezer - extends GT_MetaTileEntity_MultiBlockBase { +public class GT_MetaTileEntity_VacuumFreezer extends GT_MetaTileEntity_MultiBlockBase { public GT_MetaTileEntity_VacuumFreezer(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java index 4cf20fdf16..dabe5316ee 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java @@ -47,7 +47,7 @@ public class GT_MetaTileEntity_AlloySmelter_Bronze extends GT_MetaTileEntity_Bas public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(208)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(208), 10, 1.0F, aX, aY, aZ); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java index 94b4cfac33..8a43bf9ef4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java @@ -47,7 +47,7 @@ public class GT_MetaTileEntity_AlloySmelter_Steel extends GT_MetaTileEntity_Basi public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(208)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(208), 10, 1.0F, aX, aY, aZ); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java index 5013893cbe..4f0ce99e5b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java @@ -47,7 +47,7 @@ public class GT_MetaTileEntity_Compressor_Bronze extends GT_MetaTileEntity_Basic public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(203)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(203), 10, 1.0F, aX, aY, aZ); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java index 4a3a1e73ee..a5b26076f4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java @@ -47,7 +47,7 @@ public class GT_MetaTileEntity_Compressor_Steel extends GT_MetaTileEntity_BasicM public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(203)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(203), 10, 1.0F, aX, aY, aZ); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java index 2d36cf0e98..b8cbfb0197 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java @@ -47,7 +47,7 @@ public class GT_MetaTileEntity_Extractor_Bronze extends GT_MetaTileEntity_BasicM public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(200)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(200), 10, 1.0F, aX, aY, aZ); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java index e2d762f566..d5f3c01738 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java @@ -47,7 +47,7 @@ public class GT_MetaTileEntity_Extractor_Steel extends GT_MetaTileEntity_BasicMa public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(200)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(200), 10, 1.0F, aX, aY, aZ); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java index cc99d43c0d..ab9fee6b79 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java @@ -47,7 +47,7 @@ public class GT_MetaTileEntity_ForgeHammer_Bronze extends GT_MetaTileEntity_Basi public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(1)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(1), 10, 1.0F, aX, aY, aZ); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java index fbd256c86b..813bb3da24 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java @@ -47,7 +47,7 @@ public class GT_MetaTileEntity_ForgeHammer_Steel extends GT_MetaTileEntity_Basic public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(1)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(1), 10, 1.0F, aX, aY, aZ); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java index 3018b3c9c7..e7a83eda38 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java @@ -47,13 +47,13 @@ public class GT_MetaTileEntity_Furnace_Bronze extends GT_MetaTileEntity_BasicMac if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) { return false; } - return GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64L, new Object[]{aStack}), false, null) != null; + return mDisableFilter || GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64L, aStack), false, null) != null; } public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(207)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(207), 10, 1.0F, aX, aY, aZ); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java index 326e648213..9d0fb8309e 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java @@ -47,13 +47,13 @@ public class GT_MetaTileEntity_Furnace_Steel extends GT_MetaTileEntity_BasicMach if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) { return false; } - return GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64L, new Object[]{aStack}), false, null) != null; + return mDisableFilter || GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64L, aStack), false, null) != null; } public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(207)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(207), 10, 1.0F, aX, aY, aZ); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java index 7b60e70ad1..90f35edbc3 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java @@ -59,8 +59,6 @@ public class GT_MetaTileEntity_Macerator_Bronze extends GT_MetaTileEntity_BasicM return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; } -// if (!tRecipe.isRecipeInputEqual(true, new FluidStack[]{getFillableStack()}, getAllInputs())) -// return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; if (!tRecipe.isRecipeInputEqual(true, new FluidStack[]{getFillableStack()}, getAllInputs())) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; if (tRecipe.getOutput(0) != null) mOutputItems[0] = tRecipe.getOutput(0); @@ -73,13 +71,13 @@ public class GT_MetaTileEntity_Macerator_Bronze extends GT_MetaTileEntity_BasicM if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) { return false; } - return GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.containsInput(GT_Utility.copyAmount(64L, new Object[]{aStack})); + return mDisableFilter || GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.containsInput(GT_Utility.copyAmount(64L, aStack)); } public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(201)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(201), 10, 1.0F, aX, aY, aZ); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java index 5085f2d66b..b59f5403b4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java @@ -59,8 +59,6 @@ public class GT_MetaTileEntity_Macerator_Steel extends GT_MetaTileEntity_BasicMa return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; } -// if (!tRecipe.isRecipeInputEqual(true, new FluidStack[]{getFillableStack()}, getAllInputs())) -// return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; if (!tRecipe.isRecipeInputEqual(true, new FluidStack[]{getFillableStack()}, getAllInputs())) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; if (tRecipe.getOutput(0) != null) mOutputItems[0] = tRecipe.getOutput(0); @@ -73,13 +71,13 @@ public class GT_MetaTileEntity_Macerator_Steel extends GT_MetaTileEntity_BasicMa if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) { return false; } - return GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.containsInput(GT_Utility.copyAmount(64L, new Object[]{aStack})); + return mDisableFilter || GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.containsInput(GT_Utility.copyAmount(64L, aStack)); } public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(201)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(201), 10, 1.0F, aX, aY, aZ); } } 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 606733658b..7c6168bacb 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 @@ -1,6 +1,10 @@ package gregtech.common.tileentities.storage; +import java.util.HashMap; +import java.util.Map; + import cpw.mods.fml.common.Optional; +import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -17,8 +21,9 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; -@Optional.Interface(iface = "appeng.api.storage.IMEInventory", modid = "appliedenergistics2") -public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEntity_TieredMachineBlock implements appeng.api.storage.IMEInventory<appeng.api.storage.data.IAEItemStack> { +@Optional.Interface(iface = "appeng.api.storage.IMEMonitor", modid = "appliedenergistics2") +public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEntity_TieredMachineBlock implements appeng.api.storage.IMEMonitor<appeng.api.storage.data.IAEItemStack> { + private Map<appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack>, Object> listeners = null; public GT_MetaTileEntity_DigitalChestBase(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 3, "This Chest stores " + CommonSizeCompute(aTier) + " Blocks Use a screwdriver to enable voiding items on overflow"); } @@ -89,9 +94,10 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti } int count = getItemCount(); ItemStack stack = getItemStack(); + int savedCount = count; + if ((mInventory[0] != null) && ((count < getMaxItemCount())|| mVoidOverflow ) && GT_Utility.areStacksEqual(mInventory[0], stack)) { count += mInventory[0].stackSize; - if (count <= getMaxItemCount()) { mInventory[0] = null; } else { @@ -119,6 +125,11 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti } else { mInventory[2] = null; } + + if (GregTech_API.mAE2) + notifyListeners(count - savedCount, stack); + if (count != savedCount) + getBaseMetaTileEntity().markDirty(); } } @@ -168,7 +179,10 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti public int getMaxItemCount() { return CommonSizeCompute(mTier); } - + @Override + public ItemStack[] getStoredItemData() { + return mInventory; + } @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return aIndex == 1; @@ -248,6 +262,8 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti final ItemStack inputStack = input.getItemStack(); if (inputStack == null) return null; + if (mode != appeng.api.config.Actionable.SIMULATE) + getBaseMetaTileEntity().markDirty(); ItemStack storedStack = getItemStack(); if (storedStack != null) { if (GT_Utility.areStacksEqual(storedStack, inputStack)) { @@ -293,7 +309,9 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti @Optional.Method(modid = "appliedenergistics2") public appeng.api.storage.data.IAEItemStack extractItems(final appeng.api.storage.data.IAEItemStack request, final appeng.api.config.Actionable mode, final appeng.api.networking.security.BaseActionSource src) { - if (request.equals(getItemStack())) { + if (request.isSameType(getItemStack())) { + if (mode != appeng.api.config.Actionable.SIMULATE) + getBaseMetaTileEntity().markDirty(); if (request.getStackSize() >= getItemCount()) { appeng.util.item.AEItemStack result = appeng.util.item.AEItemStack.create(getItemStack()); result.setStackSize(getItemCount()); @@ -315,7 +333,7 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti } @Optional.Method(modid = "appliedenergistics2") - public appeng.api.storage.data.IItemList<appeng.api.storage.data.IAEItemStack> getAvailableItems(final appeng.api.storage.data.IItemList<appeng.api.storage.data.IAEItemStack> out) { + public appeng.api.storage.data.IItemList<appeng.api.storage.data.IAEItemStack> getAvailableItems(final appeng.api.storage.data.IItemList out) { ItemStack storedStack = getItemStack(); if (storedStack != null) { appeng.util.item.AEItemStack s = appeng.util.item.AEItemStack.create(storedStack); @@ -324,4 +342,92 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti } return out; } + + @Optional.Method(modid = "appliedenergistics2") + @Override + public appeng.api.storage.data.IItemList<appeng.api.storage.data.IAEItemStack> getStorageList() { + appeng.api.storage.data.IItemList<appeng.api.storage.data.IAEItemStack> res = new appeng.util.item.ItemList(); + ItemStack storedStack = getItemStack(); + if (storedStack != null) { + appeng.util.item.AEItemStack s = appeng.util.item.AEItemStack.create(storedStack); + s.setStackSize(getItemCount()); + res.add(s); + } + return res; + } + + @Optional.Method(modid = "appliedenergistics2") + @Override + public void addListener(appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack> imeMonitorHandlerReceiver, Object o) { + if (listeners == null) + listeners = new HashMap<>(); + listeners.put(imeMonitorHandlerReceiver, o); + } + + @Optional.Method(modid = "appliedenergistics2") + @Override + public void removeListener(appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack> imeMonitorHandlerReceiver) { + if (listeners == null) + listeners = new HashMap<>(); + listeners.remove(imeMonitorHandlerReceiver); + } + + @Optional.Method(modid = "appliedenergistics2") + @Override + public appeng.api.config.AccessRestriction getAccess() { + return appeng.api.config.AccessRestriction.READ_WRITE; + } + + @Optional.Method(modid = "appliedenergistics2") + @Override + public boolean isPrioritized(appeng.api.storage.data.IAEItemStack iaeItemStack) { + return false; + } + + @Optional.Method(modid = "appliedenergistics2") + @Override + public boolean canAccept(appeng.api.storage.data.IAEItemStack iaeItemStack) { + ItemStack s = getItemStack(); + if (s == null || iaeItemStack == null) + return true; + return iaeItemStack.isSameType(s); + } + + @Optional.Method(modid = "appliedenergistics2") + @Override + public int getPriority() { + return 0; + } + + @Optional.Method(modid = "appliedenergistics2") + @Override + public int getSlot() { + return 0; + } + + @Optional.Method(modid = "appliedenergistics2") + @Override + public boolean validForPass(int i) { + return true; + } + + @Optional.Method(modid = "appliedenergistics2") + private void notifyListeners(int count, ItemStack stack) { + if (listeners == null) { + listeners = new HashMap<>(); + return; + } + if (count == 0 || stack == null) + return; + appeng.util.item.ItemList change = new appeng.util.item.ItemList(); + appeng.util.item.AEItemStack s = appeng.util.item.AEItemStack.create(stack); + s.setStackSize(count); + change.add(s); + listeners.forEach((l,o) ->{ + if (l.isValid(o)) + l.postChange(this, change, null); + else + removeListener(l); + }); + } } diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_Locker.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_Locker.java index 1eb62153e7..2eb68e6767 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_Locker.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_Locker.java @@ -13,12 +13,11 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -public class GT_MetaTileEntity_Locker - extends GT_MetaTileEntity_TieredMachineBlock { +public class GT_MetaTileEntity_Locker extends GT_MetaTileEntity_TieredMachineBlock { public byte mType = 0; public GT_MetaTileEntity_Locker(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 4, "Stores and recharges Armor", new ITexture[0]); + super(aID, aName, aNameRegional, aTier, 4, "Stores and recharges Armor"); } public GT_MetaTileEntity_Locker(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -130,7 +129,7 @@ public class GT_MetaTileEntity_Locker public void doSound(byte aIndex, double aX, double aY, double aZ) { if (aIndex == 16) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(3)), 1, 1.0F); + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(3), 1, 1.0F); } } diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java index 10a1a14bda..812f9970ea 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java @@ -10,8 +10,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -public class GT_MetaTileEntity_QuantumTank - extends GT_MetaTileEntity_BasicTank { +public class GT_MetaTileEntity_QuantumTank extends GT_MetaTileEntity_BasicTank { public GT_MetaTileEntity_QuantumTank(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 3, "Stores " + CommonSizeCompute(aTier) + "L of fluid"); } |