diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 58ca7ed8..9f3402d1 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -785,18 +785,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { throw new IllegalArgumentException("Mode cannot be null"); } - if (mode != getGameMode()) { - PlayerGameModeChangeEvent event = new PlayerGameModeChangeEvent(this, mode); - server.getPluginManager().callEvent(event); - if (event.isCancelled()) { - return; - } - - getHandle().setSpectatorTarget(getHandle()); - getHandle().playerInteractManager.setGameMode(EnumGamemode.getById(mode.getValue())); - getHandle().fallDistance = 0; - getHandle().playerConnection.sendPacket(new PacketPlayOutGameStateChange(3, mode.getValue())); - } + getHandle().a(EnumGamemode.getById(mode.getValue())); } @Override |