From 4af253bb40a75280f2d4dc9b62c160e194a2226c Mon Sep 17 00:00:00 2001 From: 17146 <1714673995@qq.com> Date: Sat, 7 Dec 2024 01:06:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=85=85=E7=94=B5=E7=AB=99?= =?UTF-8?q?=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../block/entity/ChargingStationBlockEntity.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 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 afe65faaf..dc6d20d22 100644 --- a/src/main/java/com/atsuishio/superbwarfare/block/entity/ChargingStationBlockEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/block/entity/ChargingStationBlockEntity.java @@ -48,7 +48,8 @@ public class ChargingStationBlockEntity extends BlockEntity implements WorldlyCo public static final int MAX_DATA_COUNT = 3; public static final int DEFAULT_FUEL_TIME = 1600; public static final int CHARGE_SPEED = 128; - public static final int CHARGE_RADIUS = 4; + public static final int CHARGE_OTHER_SPEED = 100000; + public static final int CHARGE_RADIUS = 8; protected NonNullList items = NonNullList.withSize(2, ItemStack.EMPTY); @@ -161,8 +162,8 @@ public class ChargingStationBlockEntity extends BlockEntity implements WorldlyCo entities.forEach(entity -> { if (entity instanceof IChargeEntity chargeEntity) { if (handler.getEnergyStored() > 0) { - handler.extractEnergy(Math.min(CHARGE_SPEED, handler.getEnergyStored()), false); - chargeEntity.charge(Math.min(CHARGE_SPEED, handler.getEnergyStored())); + handler.extractEnergy(Math.min(CHARGE_OTHER_SPEED, handler.getEnergyStored()), false); + chargeEntity.charge(Math.min(CHARGE_OTHER_SPEED, handler.getEnergyStored())); } } }); @@ -175,8 +176,8 @@ public class ChargingStationBlockEntity extends BlockEntity implements WorldlyCo stack.getCapability(ForgeCapabilities.ENERGY).ifPresent(consumer -> { if (consumer.getEnergyStored() < consumer.getMaxEnergyStored()) { - consumer.receiveEnergy(Math.min(CHARGE_SPEED, handler.getEnergyStored()), false); - handler.extractEnergy(Math.min(CHARGE_SPEED, handler.getEnergyStored()), false); + consumer.receiveEnergy(Math.min(CHARGE_OTHER_SPEED, handler.getEnergyStored()), false); + handler.extractEnergy(Math.min(CHARGE_OTHER_SPEED, handler.getEnergyStored()), false); this.setChanged(); } });