Skip to content

Commit

Permalink
Fix sliding door crash on servers
Browse files Browse the repository at this point in the history
  • Loading branch information
andersmmg committed May 29, 2024
1 parent b89d308 commit 59c5ff4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public void tick() {
}

void setOpen(BlockState state, boolean open) {
this.world.setBlockState(this.getPos(), (BlockState) state.with(BoxBlock.OPEN, open), Block.NOTIFY_ALL);
this.world.setBlockState(this.getPos(), state.with(BoxBlock.OPEN, open), Block.NOTIFY_ALL);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ public SlidingDoorBlockEntity(BlockPos pos, BlockState state) {
}

public static void tick(World world, BlockPos pos, BlockState state, SlidingDoorBlockEntity blockEntity) {
blockEntity.updateAnimation(world, pos, state);
if (world.isClient) {
blockEntity.updateAnimation(world, pos, state);
}
}

@Environment(EnvType.CLIENT)
Expand Down

0 comments on commit 59c5ff4

Please sign in to comment.