diff options
author | Prometheus0000 <prometheus0000000@gmail.com> | 2020-10-16 20:35:08 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-16 20:35:08 -0400 |
commit | 3041e730df6c02d5aab897de8e573fff19288960 (patch) | |
tree | 616b0a45edc5693ff31d245af65269d638e06fb0 /src/main | |
parent | d8896f251fb8980555a12b5e827cd710cce90814 (diff) | |
parent | c8fdf1ad82c2a7695a562ea9a9a346f13aa4f2e8 (diff) | |
download | GT5-Unofficial-3041e730df6c02d5aab897de8e573fff19288960.tar.gz GT5-Unofficial-3041e730df6c02d5aab897de8e573fff19288960.tar.bz2 GT5-Unofficial-3041e730df6c02d5aab897de8e573fff19288960.zip |
Merge pull request #2 from GTNewHorizons/experimental
update
Diffstat (limited to 'src/main')
3 files changed, 42 insertions, 11 deletions
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 673c2cabaf..6ceebc3877 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 @@ -18,8 +18,10 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import static gregtech.api.enums.GT_Values.debugCleanroom; +import static gregtech.api.enums.GT_Values.V; public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBase { + private int mHeight = -1; public GT_MetaTileEntity_Cleanroom(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -46,17 +48,20 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas "Up to 10 Machine Hull Item & Energy transfer through walls", "Remaining Blocks: Plascrete, 20 min", GT_Values.cleanroomGlass+"% of the Plascrete can be Reinforced Glass (min 20 Plascrete still apply)", - "Consumes 40 EU/t when first turned on and 4 EU/t once at 100% efficiency", + "Consumes 40 EU/t when first turned on and 4 EU/t once at 100% efficiency when not overclocked", "An energy hatch accepts up to 2A, so you can use 2A LV or 1A MV", "2 LV batteries + 1 LV generator or 1 MV generator", + "Time required to reach full efficiency is propotional to the height of empty space within.", "Make sure your Energy Hatch matches!"}; } @Override public boolean checkRecipe(ItemStack aStack) { mEfficiencyIncrease = 100; - mMaxProgresstime = 100; - mEUt = -4; + // use the standard overclock mechanism to determine duration and estimate a maximum consumption + calculateOverclockedNessMulti(40, 45 * Math.min(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; } @@ -231,6 +236,8 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas float ratio = (((float)mPlascreteCount)/100f)* GT_Values.cleanroomGlass; + this.mHeight = -y; + return mPlascreteCount>=20 && mGlassCount < (int) Math.floor(ratio); } 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 43c1778d8f..6d97d9011d 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 @@ -15,11 +15,12 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; 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> { public GT_MetaTileEntity_DigitalChestBase(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 3, "This Chest stores " + CommonSizeCompute(aTier) + " Blocks"); + super(aID, aName, aNameRegional, aTier, 3, "This Chest stores " + CommonSizeCompute(aTier) + " Blocks Use a screwdriver to enable voiding items on overflow"); } public GT_MetaTileEntity_DigitalChestBase(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -56,6 +57,14 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti aBaseMetaTileEntity.openGUI(aPlayer); return true; } + + protected boolean mVoidOverflow = false; + + @Override + public final void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + mVoidOverflow = !mVoidOverflow; + GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal(mVoidOverflow ? "GT5U.machines.voidoveflow.enabled" : "GT5U.machines.voidoveflow.disabled")); + } @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { @@ -80,13 +89,13 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti } int count = getItemCount(); ItemStack stack = getItemStack(); - if ((mInventory[0] != null) && (count < getMaxItemCount()) && GT_Utility.areStacksEqual(mInventory[0], stack)) { + if ((mInventory[0] != null) && ((count < getMaxItemCount())|| mVoidOverflow ) && GT_Utility.areStacksEqual(mInventory[0], stack)) { count += mInventory[0].stackSize; - if (count > getMaxItemCount()) { + if (count <= getMaxItemCount() || mVoidOverflow ) { + mInventory[0] = null; + } else { mInventory[0].stackSize = (count - getMaxItemCount()); count = getMaxItemCount(); - } else { - mInventory[0] = null; } } if (mInventory[1] == null && stack != null) { @@ -182,6 +191,7 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti aNBT.setInteger("mItemCount", getItemCount()); if (getItemStack() != null) aNBT.setTag("mItemStack", getItemStack().writeToNBT(new NBTTagCompound())); + aNBT.setBoolean("mVoidOverflow", mVoidOverflow); } @Override @@ -190,6 +200,8 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti setItemCount(aNBT.getInteger("mItemCount")); if (aNBT.hasKey("mItemStack")) setItemStack(ItemStack.loadItemStackFromNBT((NBTTagCompound) aNBT.getTag("mItemStack"))); + mVoidOverflow = aNBT.getBoolean("mVoidOverflow"); + } @Override @@ -235,7 +247,18 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti if (storedStack != null) { if (GT_Utility.areStacksEqual(storedStack, inputStack)) { if (input.getStackSize() + getItemCount() > getMaxItemCount()) - return createOverflowStack(input.getStackSize() + getItemCount(), mode); + { + if (mVoidOverflow) + { + if (mode != appeng.api.config.Actionable.SIMULATE) + setItemCount(getMaxItemCount()); + return null; + } + else + { + return createOverflowStack(input.getStackSize() + getItemCount(), mode); + } + } else { if (mode != appeng.api.config.Actionable.SIMULATE) setItemCount(getItemCount() + (int) input.getStackSize()); diff --git a/src/main/resources/assets/gregtech/lang/en_US.lang b/src/main/resources/assets/gregtech/lang/en_US.lang index bda0fbff87..88616c6041 100644 --- a/src/main/resources/assets/gregtech/lang/en_US.lang +++ b/src/main/resources/assets/gregtech/lang/en_US.lang @@ -41,7 +41,8 @@ GT5U.machines.separatebus=Input busses are separated GT5U.machines.pumpareaset=Pumping area set to GT5U.machines.oilfluidpump=Oil/Fluid Pump GT5U.machines.minermulti=Multiblock Miner - +GT5U.machines.voidoveflow.enabled=Overflow voiding enabled +GT5U.machines.voidoveflow.disabled=Overflow voiding disabled @@ -1016,4 +1017,4 @@ gregtech.areaExploratory=Exploratory gregtech.speedUnproductive=Unproductive gregtech.speedAccelerated=Accelerated gregtech.lifeBlink=Blink -gregtech.lifeEon=Eon
\ No newline at end of file +gregtech.lifeEon=Eon |