Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fishshi committed Sep 21, 2024
1 parent 7159947 commit e36f266
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public final class ServerEntityWorldChangeEvents {
*/
public static final Event<AllowPlayerChange> ALLOW_PLAYER_CHANGE_WORLD = EventFactory.createArrayBacked(AllowPlayerChange.class, callbacks -> (player, origin, destination) -> {
for (AllowPlayerChange callback : callbacks) {
if (!callback.allowChangeWorld(player, origin, destination)){
if (!callback.allowChangeWorld(player, origin, destination)) {
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void onInitialize() {
});

ServerEntityWorldChangeEvents.ALLOW_PLAYER_CHANGE_WORLD.register((player, origin, destination) -> {
if (player.getStackInHand(Hand.MAIN_HAND).getItem() == Items.END_ROD) {
if (player.getMainHandStack().isOf(Items.END_ROD)) {
LOGGER.info("Player {} failed to change world because of handing an end rod", player.getGameProfile().getName());
return false;
}
Expand Down

0 comments on commit e36f266

Please sign in to comment.