From ef61988f6121546034a8a324241fc4155d8f4fa5 Mon Sep 17 00:00:00 2001 From: dragonruler1000 Date: Sat, 17 May 2025 16:42:03 -0500 Subject: [PATCH] Fix block activation logic and add server-side message Reversed client/server check to ensure correct logic during block activation. Added a server-side message to notify players when the block is activated. This improves clarity and ensures consistent behavior across client and server. Signed-off-by: dragonruler1000 --- .../java/us/minecraftchest2/hdm_mod/block/custom/Window.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/us/minecraftchest2/hdm_mod/block/custom/Window.java b/src/main/java/us/minecraftchest2/hdm_mod/block/custom/Window.java index c811185..e3ad55e 100644 --- a/src/main/java/us/minecraftchest2/hdm_mod/block/custom/Window.java +++ b/src/main/java/us/minecraftchest2/hdm_mod/block/custom/Window.java @@ -102,10 +102,11 @@ public class Window extends HorizontalBlock { @Override public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { - if (worldIn.isRemote()) { + if (!worldIn.isRemote()) { player.sendStatusMessage(new StringTextComponent("Client: Block activated!"), true); return ActionResultType.SUCCESS; } + player.sendMessage(new StringTextComponent("blockActivated"), player.getUniqueID()); if (!worldIn.isRemote()) return super.onBlockActivated(state, worldIn, pos, player, handIn, hit); if (player.isCrouching()) return super.onBlockActivated(state, worldIn, pos, player, handIn, hit);