From 303e3c39ab9cc5cdd2aa25dd9123682ffd9eeb38 Mon Sep 17 00:00:00 2001 From: 17146 <1714673995@qq.com> Date: Sun, 2 Mar 2025 19:32:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=85=E7=94=B5=E7=AB=99?= =?UTF-8?q?=E5=85=85=E8=83=BD=E9=A2=91=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../superbwarfare/block/entity/ChargingStationBlockEntity.java | 3 ++- .../block/entity/CreativeChargingStationBlockEntity.java | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/atsuishio/superbwarfare/block/entity/ChargingStationBlockEntity.java b/src/main/java/com/atsuishio/superbwarfare/block/entity/ChargingStationBlockEntity.java index 423d31279..a8c8789d0 100644 --- a/src/main/java/com/atsuishio/superbwarfare/block/entity/ChargingStationBlockEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/block/entity/ChargingStationBlockEntity.java @@ -190,11 +190,12 @@ public class ChargingStationBlockEntity extends BlockEntity implements WorldlyCo private void chargeEntity(EnergyStorage handler) { if (this.level == null) return; + if (this.level.getGameTime() % 20 != 0) return; List entities = this.level.getEntitiesOfClass(Entity.class, new AABB(this.getBlockPos()).inflate(CHARGE_RADIUS)); entities.forEach(entity -> entity.getCapability(ForgeCapabilities.ENERGY).ifPresent(cap -> { if (cap.canReceive()) { - int charged = cap.receiveEnergy(Math.min(handler.getEnergyStored(), CHARGE_OTHER_SPEED), false); + int charged = cap.receiveEnergy(Math.min(handler.getEnergyStored(), CHARGE_OTHER_SPEED * 20), false); handler.extractEnergy(charged, false); } })); diff --git a/src/main/java/com/atsuishio/superbwarfare/block/entity/CreativeChargingStationBlockEntity.java b/src/main/java/com/atsuishio/superbwarfare/block/entity/CreativeChargingStationBlockEntity.java index 2fa91b8ce..e05823158 100644 --- a/src/main/java/com/atsuishio/superbwarfare/block/entity/CreativeChargingStationBlockEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/block/entity/CreativeChargingStationBlockEntity.java @@ -42,6 +42,7 @@ public class CreativeChargingStationBlockEntity extends BlockEntity { private void chargeEntity() { if (this.level == null) return; + if (this.level.getGameTime() % 20 != 0) return; List entities = this.level.getEntitiesOfClass(Entity.class, new AABB(this.getBlockPos()).inflate(CHARGE_RADIUS)); entities.forEach(entity -> entity.getCapability(ForgeCapabilities.ENERGY).ifPresent(cap -> {