Skip to content

Commit

Permalink
Fix door placement leaking world
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Herrera <[email protected]>
  • Loading branch information
Pablete1234 committed Aug 22, 2024
1 parent 2d26167 commit 9a8e2eb
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ private void handleDoor(BlockTransformEvent event, Door door) {
BlockState oldState = event.getOldState().getBlock().getRelative(relative).getState();
BlockState newState = event.getBlock().getRelative(relative).getState();
BlockTransformEvent toCall;
if (event instanceof ParticipantBlockTransformEvent) {
if (event instanceof ParticipantBlockTransformEvent bte) {
toCall = new ParticipantBlockTransformEvent(
event, oldState, newState, ((ParticipantBlockTransformEvent) event).getPlayerState());
} else if (event instanceof PlayerBlockTransformEvent) {
toCall = new PlayerBlockTransformEvent(
event, oldState, newState, ((PlayerBlockTransformEvent) event).getPlayerState());
event.getCause(), oldState, newState, bte.getPlayerState());
} else if (event instanceof PlayerBlockTransformEvent bte) {
toCall =
new PlayerBlockTransformEvent(event.getCause(), oldState, newState, bte.getPlayerState());
} else {
toCall = new BlockTransformEvent(event, oldState, newState);
}
Expand Down

0 comments on commit 9a8e2eb

Please sign in to comment.