mirror of
https://github.com/dragonruler1000/hdm-mod.git
synced 2025-06-29 08:29:33 -05:00
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 <github@me.minecraftchest2.us>
This commit is contained in:
parent
8de9596a60
commit
ef61988f61
1 changed files with 2 additions and 1 deletions
|
@ -102,10 +102,11 @@ public class Window extends HorizontalBlock {
|
||||||
@Override
|
@Override
|
||||||
public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
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);
|
player.sendStatusMessage(new StringTextComponent("Client: Block activated!"), true);
|
||||||
return ActionResultType.SUCCESS;
|
return ActionResultType.SUCCESS;
|
||||||
}
|
}
|
||||||
|
player.sendMessage(new StringTextComponent("blockActivated"), player.getUniqueID());
|
||||||
|
|
||||||
if (!worldIn.isRemote()) return super.onBlockActivated(state, worldIn, pos, player, handIn, hit);
|
if (!worldIn.isRemote()) return super.onBlockActivated(state, worldIn, pos, player, handIn, hit);
|
||||||
if (player.isCrouching()) return super.onBlockActivated(state, worldIn, pos, player, handIn, hit);
|
if (player.isCrouching()) return super.onBlockActivated(state, worldIn, pos, player, handIn, hit);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue