Compare commits

...

2 commits

Author SHA1 Message Date
dragonruler1000
8a422e725f
Merge pull request #19 from dragonruler1000/DEV
Fix incorrect remote check in Window block activation
2025-05-19 22:23:44 -05:00
dragonruler1000
9cad3a926e Fix incorrect remote check in Window block activation
Previously, the remote check in the `onBlockActivated` method was reversed, causing improper behavior. This update corrects the logic to handle block activation appropriately on the client side. Additionally, an unused import line was cleaned up for clarity.

Signed-off-by: dragonruler1000 <github@me.minecraftchest2.us>
2025-05-19 22:22:13 -05:00

View file

@ -22,6 +22,7 @@ import net.minecraft.util.text.StringTextComponent;
import net.minecraft.world.IBlockReader; import net.minecraft.world.IBlockReader;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.server.ServerWorld; import net.minecraft.world.server.ServerWorld;
//import us.minecraftchest2.hdm_mod.world.dimension.ModDimensions;
import us.minecraftchest2.hdm_mod.world.dimension.ModDimensions; import us.minecraftchest2.hdm_mod.world.dimension.ModDimensions;
import us.minecraftchest2.hdm_mod.world.dimension.SimpleTeleporter; import us.minecraftchest2.hdm_mod.world.dimension.SimpleTeleporter;
@ -101,7 +102,7 @@ public class Window extends HorizontalBlock {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@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()) 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);