From 18772a36207fb0fea3868eca8aa07327501f63f3 Mon Sep 17 00:00:00 2001 From: Light_Quanta Date: Thu, 9 Jan 2025 21:50:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96showRange=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=88=A4=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../block/entity/ChargingStationBlockEntity.java | 8 ++------ 1 file changed, 2 insertions(+), 6 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 5a10ca021..ab43b85b3 100644 --- a/src/main/java/com/atsuishio/superbwarfare/block/entity/ChargingStationBlockEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/block/entity/ChargingStationBlockEntity.java @@ -105,12 +105,8 @@ public class ChargingStationBlockEntity extends BlockEntity implements WorldlyCo } public static void serverTick(Level pLevel, BlockPos pPos, BlockState pState, ChargingStationBlockEntity blockEntity) { - if (blockEntity.showRange && !pState.getValue(ChargingStationBlock.SHOW_RANGE)) { - pLevel.setBlockAndUpdate(pPos, pState.setValue(ChargingStationBlock.SHOW_RANGE, true)); - setChanged(pLevel, pPos, pState); - } - if (!blockEntity.showRange && pState.getValue(ChargingStationBlock.SHOW_RANGE)) { - pLevel.setBlockAndUpdate(pPos, pState.setValue(ChargingStationBlock.SHOW_RANGE, false)); + if (blockEntity.showRange != pState.getValue(ChargingStationBlock.SHOW_RANGE)) { + pLevel.setBlockAndUpdate(pPos, pState.setValue(ChargingStationBlock.SHOW_RANGE, blockEntity.showRange)); setChanged(pLevel, pPos, pState); }