diff options
author | NexusNull <p.wellershaus@googlemail.com> | 2022-12-28 23:10:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-28 22:10:58 +0000 |
commit | 2c31bf8538f3d4b2fa77f39c40fa5f1a01c9bfd8 (patch) | |
tree | 164820d78f966087e5f5ea3baaa725a25544add2 /src/main/java/gregtech/common | |
parent | 1a71fc3e33bac6cdb8b17a4259ea62f2b4c18de1 (diff) | |
download | GT5-Unofficial-2c31bf8538f3d4b2fa77f39c40fa5f1a01c9bfd8.tar.gz GT5-Unofficial-2c31bf8538f3d4b2fa77f39c40fa5f1a01c9bfd8.tar.bz2 GT5-Unofficial-2c31bf8538f3d4b2fa77f39c40fa5f1a01c9bfd8.zip |
Remove void break from fluid tanks and chests (#1602)
* Remove void break from fluid tanks
Previously, sneaking while breaking a fluid tank would void the contents of the tank, leading to potential loss of valuable resources. However, this behavior is not consistent with other blocks, such as chests and furnaces, which retain their contents when broken while sneaking.
This commit removes the sneak breaking voiding behavior for fluid tanks, bringing them in line with other blocks and reducing the risk of unintended loss for players.
* run spotless
* fix stray check for voidBreak
Signed-off-by: NexusNull <p.wellershaus@googlemail.com>
* remove override
Signed-off-by: NexusNull <p.wellershaus@googlemail.com>
* remove void tooltip
Signed-off-by: NexusNull <p.wellershaus@googlemail.com>
Signed-off-by: NexusNull <p.wellershaus@googlemail.com>
Diffstat (limited to 'src/main/java/gregtech/common')
3 files changed, 25 insertions, 43 deletions
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 747116400a..8ef639e89e 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 @@ -41,7 +41,6 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti implements appeng.api.storage.IMEMonitor<appeng.api.storage.data.IAEItemStack>, IAddUIWidgets { protected boolean mVoidOverflow = false; protected boolean mDisableFilter; - public boolean voidBreak; private Map<appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack>, Object> listeners = null; @@ -50,8 +49,7 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti "This Chest stores " + GT_Utility.formatNumbers(commonSizeCompute(aTier)) + " Blocks", "Use a screwdriver to enable", "voiding items on overflow", - "Can keep its contents when harvested", - "Sneak when harvesting to void its contents" + "Will keep its contents when harvested", }); } @@ -360,12 +358,6 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti } @Override - public void onLeftclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - voidBreak = aPlayer.isSneaking(); - super.onLeftclick(aBaseMetaTileEntity, aPlayer); - } - - @Override public boolean isFacingValid(byte aFacing) { return true; } diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalTankBase.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalTankBase.java index a4d1f1113f..278e4b3d15 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalTankBase.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalTankBase.java @@ -42,7 +42,6 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit implements IFluidLockable, IAddUIWidgets { public boolean mOutputFluid = false, mVoidFluidPart = false, mVoidFluidFull = false, mLockFluid = false; protected String lockedFluidName = null; - private boolean voidBreak; public boolean mAllowInputFromOutputSide = false; public GT_MetaTileEntity_DigitalTankBase(int aID, String aName, String aNameRegional, int aTier) { @@ -50,7 +49,6 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit StatCollector.translateToLocalFormatted( "GT5U.machines.digitaltank.tooltip", GT_Utility.formatNumbers(commonSizeCompute(aTier))), StatCollector.translateToLocal("GT5U.machines.digitaltank.tooltip1"), - StatCollector.translateToLocal("GT5U.machines.digitaltank.tooltip2") }); } @@ -96,17 +94,16 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit @Override public void setItemNBT(NBTTagCompound aNBT) { - if (!voidBreak) { - if (mFluid != null && mFluid.amount >= 0) { - aNBT.setTag("mFluid", mFluid.writeToNBT(new NBTTagCompound())); - } - if (mOutputFluid) aNBT.setBoolean("mOutputFluid", true); - if (mVoidFluidPart) aNBT.setBoolean("mVoidOverflow", true); - if (mVoidFluidFull) aNBT.setBoolean("mVoidFluidFull", true); - if (mLockFluid) aNBT.setBoolean("mLockFluid", true); - if (GT_Utility.isStringValid(lockedFluidName)) aNBT.setString("lockedFluidName", lockedFluidName); - if (this.mAllowInputFromOutputSide) aNBT.setBoolean("mAllowInputFromOutputSide", true); + if (mFluid != null && mFluid.amount >= 0) { + aNBT.setTag("mFluid", mFluid.writeToNBT(new NBTTagCompound())); } + if (mOutputFluid) aNBT.setBoolean("mOutputFluid", true); + if (mVoidFluidPart) aNBT.setBoolean("mVoidOverflow", true); + if (mVoidFluidFull) aNBT.setBoolean("mVoidFluidFull", true); + if (mLockFluid) aNBT.setBoolean("mLockFluid", true); + if (GT_Utility.isStringValid(lockedFluidName)) aNBT.setString("lockedFluidName", lockedFluidName); + if (this.mAllowInputFromOutputSide) aNBT.setBoolean("mAllowInputFromOutputSide", true); + super.setItemNBT(aNBT); } @@ -251,12 +248,6 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit } @Override - public void onLeftclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - voidBreak = aPlayer.isSneaking(); - super.onLeftclick(aBaseMetaTileEntity, aPlayer); - } - - @Override public final void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aSide == getBaseMetaTileEntity().getFrontFacing()) { mAllowInputFromOutputSide = !mAllowInputFromOutputSide; diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumChest.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumChest.java index 384b55cc4c..18d54215a1 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumChest.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumChest.java @@ -33,25 +33,24 @@ public class GT_MetaTileEntity_QuantumChest extends GT_MetaTileEntity_DigitalChe @Override public void setItemNBT(NBTTagCompound aNBT) { mInvData = new NBTTagList(); - if (!voidBreak) { - for (int i = 0; i < 3; i++) { - if (mInventory[i] != null) { - NBTTagCompound tNBT = new NBTTagCompound(); - tNBT.setByte("Count", (byte) mInventory[i].stackSize); - tNBT.setShort("Damage", (short) mInventory[i].getItemDamage()); - tNBT.setShort("id", (short) Item.getIdFromItem(mInventory[i].getItem())); - tNBT.setInteger("IntSlot", i); - if (mInventory[i].hasTagCompound()) { - tNBT.setTag("tag", mInventory[i].getTagCompound()); - } - mInvData.appendTag(tNBT); + for (int i = 0; i < 3; i++) { + if (mInventory[i] != null) { + NBTTagCompound tNBT = new NBTTagCompound(); + tNBT.setByte("Count", (byte) mInventory[i].stackSize); + tNBT.setShort("Damage", (short) mInventory[i].getItemDamage()); + tNBT.setShort("id", (short) Item.getIdFromItem(mInventory[i].getItem())); + tNBT.setInteger("IntSlot", i); + if (mInventory[i].hasTagCompound()) { + tNBT.setTag("tag", mInventory[i].getTagCompound()); } + mInvData.appendTag(tNBT); } - if (mItemStack != null) aNBT.setTag("mItemStack", getItemStack().writeToNBT(new NBTTagCompound())); - aNBT.setTag("Inventory", mInvData); - aNBT.setInteger("mItemCount", getItemCount()); - aNBT.setBoolean("mVoidOverflow", mVoidOverflow); } + if (mItemStack != null) aNBT.setTag("mItemStack", getItemStack().writeToNBT(new NBTTagCompound())); + aNBT.setTag("Inventory", mInvData); + aNBT.setInteger("mItemCount", getItemCount()); + aNBT.setBoolean("mVoidOverflow", mVoidOverflow); + super.setItemNBT(aNBT); } |