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")) {
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
}

View File

@ -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));

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);
}
} else {
server.getMessenger().dispatchIncomingMessage(player.getPlayer(), packet.tag, packet.data);
server.getMessenger().dispatchIncomingMessage(player.getBukkitEntity(), packet.tag, packet.data);
}
}
// CraftBukkit end