From 5619b515c01172ca46a427f89657dcf44644780a Mon Sep 17 00:00:00 2001 From: Ghzdude <44148655+ghzdude@users.noreply.github.com> Date: Wed, 20 Dec 2023 22:40:28 -0700 Subject: [PATCH] consume energy every 10 ticks scale energy usage based on tier --- .../storage/MetaTileEntityQuantumStorageController.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/gregtech/common/metatileentities/storage/MetaTileEntityQuantumStorageController.java b/src/main/java/gregtech/common/metatileentities/storage/MetaTileEntityQuantumStorageController.java index 2266a8108dc..67b765c1b9e 100644 --- a/src/main/java/gregtech/common/metatileentities/storage/MetaTileEntityQuantumStorageController.java +++ b/src/main/java/gregtech/common/metatileentities/storage/MetaTileEntityQuantumStorageController.java @@ -1,5 +1,6 @@ package gregtech.common.metatileentities.storage; +import gregtech.api.GTValues; import gregtech.api.capability.GregtechCapabilities; import gregtech.api.capability.IDualHandler; import gregtech.api.capability.IEnergyContainer; @@ -8,6 +9,7 @@ import gregtech.api.capability.impl.EnergyContainerHandler; import gregtech.api.capability.impl.FluidTankList; import gregtech.api.capability.impl.ItemHandlerList; +import gregtech.api.metatileentity.ITieredMetaTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.util.GTUtility; @@ -77,7 +79,7 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { @Override public void update() { - if (isPowered()) { + if (getOffsetTimer() % 10 == 0 && isPowered()) { energyContainer.removeEnergy(energyConsumption); } super.update(); @@ -207,7 +209,10 @@ public void rebuildNetwork() { oldPositions.remove(pos); energyConsumption += switch (storage.getType()) { - case ITEM, FLUID -> 8L; + case ITEM, FLUID -> { + int tier = storage instanceof ITieredMetaTileEntity tieredMTE ? tieredMTE.getTier() : 0; + yield GTValues.V[tier / 2] / 2; + } case PROXY -> 2L; case EXTENDER -> 1L; default -> 0L;