From c5a4bfd291af3a381a8c3f2a4a81766522039236 Mon Sep 17 00:00:00 2001 From: Erik Broes Date: Sun, 29 Jan 2012 16:06:11 +0100 Subject: [PATCH] Use OO > new method --- src/main/java/net/minecraft/server/EntityPlayer.java | 9 +++++---- src/main/java/net/minecraft/server/NetLoginHandler.java | 2 +- src/main/java/net/minecraft/server/NetServerHandler.java | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java index a3a13f2dab..5acd959cb1 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -75,13 +75,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting { if (nbttagcompound.hasKey("playerGameType")) { this.itemInWorldManager.setGameMode(nbttagcompound.getInt("playerGameType")); } - getPlayer().readExtraData(nbttagcompound); // CraftBukkit + this.getBukkitEntity().readExtraData(nbttagcompound); // CraftBukkit } public void b(NBTTagCompound nbttagcompound) { super.b(nbttagcompound); nbttagcompound.setInt("playerGameType", this.itemInWorldManager.getGameMode()); - getPlayer().setExtraData(nbttagcompound); // CraftBukkit + this.getBukkitEntity().setExtraData(nbttagcompound); // CraftBukkit } public void spawnIn(World world) { @@ -669,8 +669,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.keepLevel = false; } - public CraftPlayer getPlayer() { - return (CraftPlayer) getBukkitEntity(); + @Override + public CraftPlayer getBukkitEntity() { + return (CraftPlayer) super.getBukkitEntity(); } // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/NetLoginHandler.java b/src/main/java/net/minecraft/server/NetLoginHandler.java index 82e3804c97..afa1818ba1 100644 --- a/src/main/java/net/minecraft/server/NetLoginHandler.java +++ b/src/main/java/net/minecraft/server/NetLoginHandler.java @@ -112,7 +112,7 @@ public class NetLoginHandler extends NetHandler { maxPlayers = 60; } netserverhandler.sendPacket(new Packet1Login("", entityplayer.id, worldserver.getSeed(), worldserver.getWorldData().getType(), entityplayer.itemInWorldManager.getGameMode(), (byte) worldserver.worldProvider.dimension, (byte) worldserver.difficulty, (byte) worldserver.height, (byte) maxPlayers)); - entityplayer.getPlayer().sendSupportedChannels(); + entityplayer.getBukkitEntity().sendSupportedChannels(); // CraftBukkit end netserverhandler.sendPacket(new Packet6SpawnPosition(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z)); diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index a03b96776e..89e71cebef 100644 --- a/src/main/java/net/minecraft/server/NetServerHandler.java +++ b/src/main/java/net/minecraft/server/NetServerHandler.java @@ -1141,7 +1141,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener { Logger.getLogger(NetServerHandler.class.getName()).log(Level.SEVERE, "Could not parse UNREGISTER payload in plugin message packet", ex); } } else { - server.getMessenger().dispatchIncomingMessage(player.getPlayer(), packet.tag, packet.data); + server.getMessenger().dispatchIncomingMessage(player.getBukkitEntity(), packet.tag, packet.data); } } // CraftBukkit end