From 29f3bd55b960a16e6f4d27865a7543b6c7defd01 Mon Sep 17 00:00:00 2001 From: Atsuihsio <842960157@qq.com> Date: Sat, 7 Dec 2024 12:44:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=85=E7=94=B5Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../block/entity/ChargingStationBlockEntity.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 dc6d20d22..d02528e9b 100644 --- a/src/main/java/com/atsuishio/superbwarfare/block/entity/ChargingStationBlockEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/block/entity/ChargingStationBlockEntity.java @@ -161,10 +161,8 @@ public class ChargingStationBlockEntity extends BlockEntity implements WorldlyCo List entities = this.level.getEntitiesOfClass(Entity.class, new AABB(this.getBlockPos()).inflate(CHARGE_RADIUS)); entities.forEach(entity -> { if (entity instanceof IChargeEntity chargeEntity) { - if (handler.getEnergyStored() > 0) { - handler.extractEnergy(Math.min(CHARGE_OTHER_SPEED, handler.getEnergyStored()), false); - chargeEntity.charge(Math.min(CHARGE_OTHER_SPEED, handler.getEnergyStored())); - } + chargeEntity.charge(Math.min(CHARGE_OTHER_SPEED, handler.getEnergyStored())); + handler.extractEnergy(Math.min(CHARGE_OTHER_SPEED, handler.getEnergyStored()), false); } }); this.setChanged();