Adding a block activated check.

Signed-off-by: dragonruler1000 <github@me.minecraftchest2.us>
This commit is contained in:
dragonruler1000 2025-05-14 21:04:59 -05:00
parent c06d73ebff
commit 6915d2ae90

View file

@ -77,6 +77,8 @@ public class Window extends HorizontalBlock {
@Override @Override
public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos,
PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
player.sendMessage(new StringTextComponent("Block activated"), player.getUniqueID());
if (!worldIn.isRemote()) { if (!worldIn.isRemote()) {
if (!player.isCrouching()) { if (!player.isCrouching()) {
MinecraftServer server = worldIn.getServer(); MinecraftServer server = worldIn.getServer();