diff options
author | Erik Broes <erikbroes@grum.nl> | 2011-05-28 22:50:08 +0200 |
---|---|---|
committer | EvilSeph <evilseph@unaligned.org> | 2011-05-30 22:37:34 -0400 |
commit | 6dbd710bbf37728eb760cacb019d1e384a7e1311 (patch) | |
tree | 37b670b6e589f3fcffa116d55c099e424402dfdc /src/main/java/net/minecraft/server/EntityPlayer.java | |
parent | 9ec5d8b5dfc544a6873aa1bb48a07deedd1751fb (diff) | |
download | craftbukkit-6dbd710bbf37728eb760cacb019d1e384a7e1311.tar craftbukkit-6dbd710bbf37728eb760cacb019d1e384a7e1311.tar.gz craftbukkit-6dbd710bbf37728eb760cacb019d1e384a7e1311.tar.lz craftbukkit-6dbd710bbf37728eb760cacb019d1e384a7e1311.tar.xz craftbukkit-6dbd710bbf37728eb760cacb019d1e384a7e1311.zip |
Update for 1.6.5
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityPlayer.java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityPlayer.java | 129 |
1 files changed, 81 insertions, 48 deletions
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java index 34b42364..81a06ebf 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -25,10 +25,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public double e; public List f = new LinkedList(); public Set g = new HashSet(); - private int bJ = -99999999; - private int bK = 60; - private ItemStack[] bL = new ItemStack[] { null, null, null, null, null}; - private int bM = 0; + private int bK = -99999999; + private int bL = 60; + private ItemStack[] bM = new ItemStack[] { null, null, null, null, null}; + private int bN = 0; public boolean h; public EntityPlayer(MinecraftServer minecraftserver, World world, String s, ItemInWorldManager iteminworldmanager) { @@ -48,7 +48,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.setPositionRotation((double) i + 0.5D, (double) k, (double) j + 0.5D, 0.0F, 0.0F); this.b = minecraftserver; - this.br = 0.0F; + this.bs = 0.0F; this.name = s; this.height = 0.0F; @@ -71,7 +71,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } public ItemStack[] getEquipment() { - return this.bL; + return this.bM; } protected void j_() { @@ -82,17 +82,17 @@ public class EntityPlayer extends EntityHuman implements ICrafting { return 1.62F; } - public void p_() { + public void o_() { this.itemInWorldManager.a(); - --this.bK; + --this.bL; this.activeContainer.a(); for (int i = 0; i < 5; ++i) { ItemStack itemstack = this.b_(i); - if (itemstack != this.bL[i]) { + if (itemstack != this.bM[i]) { this.b.b(this.dimension).a(this, new Packet5EntityEquipment(this.id, i, itemstack)); - this.bL[i] = itemstack; + this.bM[i] = itemstack; } } } @@ -142,7 +142,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } public boolean damageEntity(Entity entity, int i) { - if (this.bK > 0) { + if (this.bL > 0) { return false; } else { if (!this.b.pvpMode) { @@ -171,8 +171,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting { super.b(i); } - public void a(boolean flag) { - super.p_(); + // CraftBukkit return EntityPlayer + public EntityPlayer a(boolean flag) { + super.o_(); for (int i = 0; i < this.inventory.getSize(); ++i) { ItemStack itemstack = this.inventory.getItem(i); @@ -210,39 +211,43 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } } - if (this.D) { + EntityPlayer player = this; // CraftBukkit + if (this.E) { if (this.b.propertyManager.getBoolean("allow-nether", true)) { if (this.vehicle != null) { this.mount(this.vehicle); } else { - this.E += 0.0125F; - if (this.E >= 1.0F) { - this.E = 1.0F; - this.C = 10; - this.b.serverConfigurationManager.f(this); + this.F += 0.0125F; + if (this.F >= 1.0F) { + this.F = 1.0F; + this.D = 10; + player = this.b.serverConfigurationManager.f(this); // CraftBukkit } } - this.D = false; + player.E = false; // CraftBukkit } } else { - if (this.E > 0.0F) { - this.E -= 0.05F; + if (this.F > 0.0F) { + this.F -= 0.05F; } - if (this.E < 0.0F) { - this.E = 0.0F; + if (this.F < 0.0F) { + this.F = 0.0F; } } - if (this.C > 0) { - --this.C; + // CraftBukkit start + if (player.D > 0) { + --player.D; } - if (this.health != this.bJ) { - this.netServerHandler.sendPacket(new Packet8UpdateHealth(this.health)); - this.bJ = this.health; + if (player.health != player.bK) { + player.netServerHandler.sendPacket(new Packet8UpdateHealth(this.health)); + player.bK = player.health; } + return player; + // CraftBukkit end } private void a(TileEntity tileentity) { @@ -294,7 +299,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { if (enumbederror == EnumBedError.OK) { EntityTracker entitytracker = this.b.b(this.dimension); - entitytracker.a(this, new Packet17(this, 0, i, j, k)); + // CraftBukkit - this is not the original method called + entitytracker.b(this, new Packet17(this, 0, i, j, k)); } return enumbederror; @@ -308,7 +314,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } super.a(flag, flag1, flag2); - this.netServerHandler.a(this.locX, this.locY, this.locZ, this.yaw, this.pitch); + if (this.netServerHandler != null) { + this.netServerHandler.a(this.locX, this.locY, this.locZ, this.yaw, this.pitch); + } } public void mount(Entity entity) { @@ -333,39 +341,39 @@ public class EntityPlayer extends EntityHuman implements ICrafting { super.a(d0, flag); } - private void af() { - this.bM = this.bM % 100 + 1; + private void ah() { + this.bN = this.bN % 100 + 1; } public void b(int i, int j, int k) { - this.af(); - this.netServerHandler.sendPacket(new Packet100OpenWindow(this.bM, 1, "Crafting", 9)); + this.ah(); + this.netServerHandler.sendPacket(new Packet100OpenWindow(this.bN, 1, "Crafting", 9)); this.activeContainer = new ContainerWorkbench(this.inventory, this.world, i, j, k); - this.activeContainer.f = this.bM; + this.activeContainer.f = this.bN; this.activeContainer.a((ICrafting) this); } public void a(IInventory iinventory) { - this.af(); - this.netServerHandler.sendPacket(new Packet100OpenWindow(this.bM, 0, iinventory.getName(), iinventory.getSize())); + this.ah(); + this.netServerHandler.sendPacket(new Packet100OpenWindow(this.bN, 0, iinventory.getName(), iinventory.getSize())); this.activeContainer = new ContainerChest(this.inventory, iinventory); - this.activeContainer.f = this.bM; + this.activeContainer.f = this.bN; this.activeContainer.a((ICrafting) this); } public void a(TileEntityFurnace tileentityfurnace) { - this.af(); - this.netServerHandler.sendPacket(new Packet100OpenWindow(this.bM, 2, tileentityfurnace.getName(), tileentityfurnace.getSize())); + this.ah(); + this.netServerHandler.sendPacket(new Packet100OpenWindow(this.bN, 2, tileentityfurnace.getName(), tileentityfurnace.getSize())); this.activeContainer = new ContainerFurnace(this.inventory, tileentityfurnace); - this.activeContainer.f = this.bM; + this.activeContainer.f = this.bN; this.activeContainer.a((ICrafting) this); } public void a(TileEntityDispenser tileentitydispenser) { - this.af(); - this.netServerHandler.sendPacket(new Packet100OpenWindow(this.bM, 3, tileentitydispenser.getName(), tileentitydispenser.getSize())); + this.ah(); + this.netServerHandler.sendPacket(new Packet100OpenWindow(this.bN, 3, tileentitydispenser.getName(), tileentitydispenser.getSize())); this.activeContainer = new ContainerDispenser(this.inventory, tileentitydispenser); - this.activeContainer.f = this.bM; + this.activeContainer.f = this.bN; this.activeContainer.a((ICrafting) this); } @@ -409,9 +417,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } public void a(float f, float f1, boolean flag, boolean flag1, float f2, float f3) { - this.ay = f; - this.az = f1; - this.aB = flag; + this.az = f; + this.aA = f1; + this.aC = flag; this.setSneak(flag1); this.pitch = f2; this.yaw = f3; @@ -430,6 +438,31 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } } + public void A() { + if (this.vehicle != null) { + this.mount(this.vehicle); + } + + if (this.passenger != null) { + this.passenger.mount(this); + } + + if (this.sleeping) { + this.a(true, false, false); + } + } + + public void B() { + this.bK = -99999999; + } + + public void a(String s) { + StatisticStorage statisticstorage = StatisticStorage.a(); + String s1 = statisticstorage.a(s); + + this.netServerHandler.sendPacket(new Packet3Chat(s1)); + } + // CraftBukkit start @Override public String toString() { |