Use OO > new method

This commit is contained in:
Erik Broes 2012-01-29 16:06:11 +01:00
parent 3173b68bbe
commit c5a4bfd291
3 changed files with 7 additions and 6 deletions

View File

@ -75,13 +75,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
if (nbttagcompound.hasKey("playerGameType")) { if (nbttagcompound.hasKey("playerGameType")) {
this.itemInWorldManager.setGameMode(nbttagcompound.getInt("playerGameType")); this.itemInWorldManager.setGameMode(nbttagcompound.getInt("playerGameType"));
} }
getPlayer().readExtraData(nbttagcompound); // CraftBukkit this.getBukkitEntity().readExtraData(nbttagcompound); // CraftBukkit
} }
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
super.b(nbttagcompound); super.b(nbttagcompound);
nbttagcompound.setInt("playerGameType", this.itemInWorldManager.getGameMode()); nbttagcompound.setInt("playerGameType", this.itemInWorldManager.getGameMode());
getPlayer().setExtraData(nbttagcompound); // CraftBukkit this.getBukkitEntity().setExtraData(nbttagcompound); // CraftBukkit
} }
public void spawnIn(World world) { public void spawnIn(World world) {
@ -669,8 +669,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.keepLevel = false; this.keepLevel = false;
} }
public CraftPlayer getPlayer() { @Override
return (CraftPlayer) getBukkitEntity(); public CraftPlayer getBukkitEntity() {
return (CraftPlayer) super.getBukkitEntity();
} }
// CraftBukkit end // CraftBukkit end
} }

View File

@ -112,7 +112,7 @@ public class NetLoginHandler extends NetHandler {
maxPlayers = 60; 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)); 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 // CraftBukkit end
netserverhandler.sendPacket(new Packet6SpawnPosition(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z)); netserverhandler.sendPacket(new Packet6SpawnPosition(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z));

View File

@ -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); Logger.getLogger(NetServerHandler.class.getName()).log(Level.SEVERE, "Could not parse UNREGISTER payload in plugin message packet", ex);
} }
} else { } else {
server.getMessenger().dispatchIncomingMessage(player.getPlayer(), packet.tag, packet.data); server.getMessenger().dispatchIncomingMessage(player.getBukkitEntity(), packet.tag, packet.data);
} }
} }
// CraftBukkit end // CraftBukkit end