diff options
author | Glease <4586901+Glease@users.noreply.github.com> | 2022-10-09 18:17:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-09 12:17:10 +0200 |
commit | eedb84e125cac3f9fade78ab1ec31e256ba3449f (patch) | |
tree | b68628174d97e2f736f44e145268b01c1120ee4d /src/main/java/gregtech/common/blocks | |
parent | 7e3b2f926c6ccf6a38b9f541aa9da371b4898bd4 (diff) | |
download | GT5-Unofficial-eedb84e125cac3f9fade78ab1ec31e256ba3449f.tar.gz GT5-Unofficial-eedb84e125cac3f9fade78ab1ec31e256ba3449f.tar.bz2 GT5-Unofficial-eedb84e125cac3f9fade78ab1ec31e256ba3449f.zip |
digital chests improvements (#1450)
* unify super chest and quantum chest code base
* add item info to waila
* add an input filter to digital chests
Diffstat (limited to 'src/main/java/gregtech/common/blocks')
-rw-r--r-- | src/main/java/gregtech/common/blocks/GT_Block_Machines.java | 4 | ||||
-rw-r--r-- | src/main/java/gregtech/common/blocks/GT_Item_Machines.java | 17 |
2 files changed, 9 insertions, 12 deletions
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java index b497ccaa8e..7a1ae279c1 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java @@ -25,7 +25,6 @@ import gregtech.api.util.GT_Log; import gregtech.api.util.GT_Utility; import gregtech.common.render.GT_Renderer_Block; import gregtech.common.tileentities.storage.GT_MetaTileEntity_QuantumChest; -import gregtech.common.tileentities.storage.GT_MetaTileEntity_SuperChest; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -412,8 +411,7 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo if (tTileEntity instanceof IGregTechTileEntity) { final IGregTechTileEntity tGregTechTileEntity = (IGregTechTileEntity) tTileEntity; mTemporaryTileEntity.set(tGregTechTileEntity); - if (!(tGregTechTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_SuperChest - || tGregTechTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_QuantumChest)) { + if (!(tGregTechTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_QuantumChest)) { for (int i = 0; i < tGregTechTileEntity.getSizeInventory(); i++) { final ItemStack tItem = tGregTechTileEntity.getStackInSlot(i); if ((tItem != null) && (tItem.stackSize > 0) && (tGregTechTileEntity.isValidSlot(i))) { diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java index 95de8da0c2..6ee2db6b6e 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java @@ -328,8 +328,7 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { super.onUpdate(aStack, aWorld, aPlayer, aTimer, aIsInHand); final short tDamage = (short) getDamage(aStack); final EntityLivingBase tPlayer = (EntityPlayer) aPlayer; - if (GregTech_API.METATILEENTITIES[tDamage] instanceof GT_MetaTileEntity_SuperChest - || GregTech_API.METATILEENTITIES[tDamage] instanceof GT_MetaTileEntity_QuantumChest + if (GregTech_API.METATILEENTITIES[tDamage] instanceof GT_MetaTileEntity_QuantumChest || GregTech_API.METATILEENTITIES[tDamage] instanceof GT_MetaTileEntity_SuperTank || GregTech_API.METATILEENTITIES[tDamage] instanceof GT_MetaTileEntity_QuantumTank) { final NBTTagCompound tNBT = aStack.stackTagCompound; @@ -342,19 +341,19 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { || (tNBT.hasKey("mFluid") && FluidStack.loadFluidStackFromNBT(tNBT.getCompoundTag("mFluid")).amount > 64000)) { final FluidStack tFluid = FluidStack.loadFluidStackFromNBT(tNBT.getCompoundTag("mFluid")); - int tLasing = 1200; + int tEffectDuration = 1200; if (tFluid != null) { final double tFluidAmount = tFluid.amount; final double tMiddlePoint = 4096000; final double tSmoothingCoefficient = 2000000; - final int tMaxLastingTime = 12000; + final int tMaxDuration = 12000; final double tmp = (tFluidAmount - tMiddlePoint) / tSmoothingCoefficient; - tLasing = (int) (Math.exp(tmp) / (Math.exp(tmp) + Math.exp(-tmp)) * tMaxLastingTime); + tEffectDuration = (int) (Math.exp(tmp) / (Math.exp(tmp) + Math.exp(-tmp)) * tMaxDuration); } - tPlayer.addPotionEffect(new PotionEffect(Potion.hunger.id, tLasing, 1)); - tPlayer.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, tLasing, 1)); - tPlayer.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, tLasing, 1)); - tPlayer.addPotionEffect(new PotionEffect(Potion.weakness.id, tLasing, 1)); + tPlayer.addPotionEffect(new PotionEffect(Potion.hunger.id, tEffectDuration, 1)); + tPlayer.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, tEffectDuration, 1)); + tPlayer.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, tEffectDuration, 1)); + tPlayer.addPotionEffect(new PotionEffect(Potion.weakness.id, tEffectDuration, 1)); } } } |