diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-02-23 02:37:56 +0000 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-02-23 02:37:56 +0000 |
commit | f759e0b60d3a575d31921c930e436af321b0e7e8 (patch) | |
tree | 4b1eb7ac01670854c686b1f6faa2f97ff337f7d7 /src/main/java/net/minecraft/server/ItemInWorldManager.java | |
parent | a124bfdab59cc9a9d8369425027e61eccd1d62fb (diff) | |
download | craftbukkit-f759e0b60d3a575d31921c930e436af321b0e7e8.tar craftbukkit-f759e0b60d3a575d31921c930e436af321b0e7e8.tar.gz craftbukkit-f759e0b60d3a575d31921c930e436af321b0e7e8.tar.lz craftbukkit-f759e0b60d3a575d31921c930e436af321b0e7e8.tar.xz craftbukkit-f759e0b60d3a575d31921c930e436af321b0e7e8.zip |
Update to Minecraft 1.3 beta
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemInWorldManager.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemInWorldManager.java | 107 |
1 files changed, 63 insertions, 44 deletions
diff --git a/src/main/java/net/minecraft/server/ItemInWorldManager.java b/src/main/java/net/minecraft/server/ItemInWorldManager.java index 5ca0dca1..df38c5bc 100644 --- a/src/main/java/net/minecraft/server/ItemInWorldManager.java +++ b/src/main/java/net/minecraft/server/ItemInWorldManager.java @@ -9,82 +9,100 @@ public class ItemInWorldManager { private World b; public EntityHuman a; - private float c; - public float d = 0.0F; // CraftBukkit private -> public + public float c = 0.0F; // CraftBukkit private -> public + private int d; private int e = 0; private float f = 0.0F; private int g; private int h; private int i; + private int j; + private boolean k; + private int l; + private int m; + private int n; + private int o; public ItemInWorldManager(World world) { this.b = world; } + public void a() { + ++this.j; + if (this.k) { + int i = this.j - this.o; + int j = this.b.getTypeId(this.l, this.m, this.n); + + if (j != 0) { + Block block = Block.byId[j]; + float f = block.a(this.a) * (float) (i + 1); + + if (f >= 1.0F) { + this.k = false; + this.d(this.l, this.m, this.n); + } + } else { + this.k = false; + } + } + } + public void a(int i, int j, int k) { + this.d = this.j; int l = this.b.getTypeId(i, j, k); - if (l > 0 && this.d == 0.0F) { + if (l > 0) { Block.byId[l].b(this.b, i, j, k, this.a); } if (l > 0 && Block.byId[l].a(this.a) >= 1.0F) { - this.c(i, j, k); + this.d(i, j, k); + } else { + this.g = i; + this.h = j; + this.i = k; } } - public void a() { - this.d = 0.0F; - this.e = 0; - } - - public void a(int i, int j, int k, int l) { - if (this.e > 0) { - --this.e; - } else { - if (i == this.g && j == this.h && k == this.i) { - int i1 = this.b.getTypeId(i, j, k); - - if (i1 == 0) { - return; - } + public void b(int i, int j, int k) { + if (i == this.g && j == this.h && k == this.i) { + int l = this.j - this.d; + int i1 = this.b.getTypeId(i, j, k); + if (i1 != 0) { Block block = Block.byId[i1]; - - this.d += block.a(this.a); - ++this.f; - if (this.d >= 1.0F) { - this.c(i, j, k); - this.d = 0.0F; - this.c = 0.0F; - this.f = 0.0F; - this.e = 5; + float f = block.a(this.a) * (float) (l + 1); + + if (f >= 1.0F) { + this.d(i, j, k); + } else if (!this.k) { + this.k = true; + this.l = i; + this.m = j; + this.n = k; + this.o = this.d; } - } else { - this.d = 0.0F; - this.c = 0.0F; - this.f = 0.0F; - this.g = i; - this.h = j; - this.i = k; } } + + this.c = 0.0F; + this.e = 0; } - public boolean b(int i, int j, int k) { + public boolean c(int i, int j, int k) { Block block = Block.byId[this.b.getTypeId(i, j, k)]; int l = this.b.getData(i, j, k); boolean flag = this.b.e(i, j, k, 0); if (block != null && flag) { - block.a(this.b, i, j, k, l); + block.b(this.b, i, j, k, l); } return flag; } - public boolean c(int i, int j, int k) { - //CraftBukkit start + public boolean d(int i, int j, int k) { + // CraftBukkit start if (this.a instanceof EntityPlayer){ CraftServer server = ((WorldServer) this.b).getServer(); org.bukkit.block.Block block = ((WorldServer) this.b).getWorld().getBlockAt(i, j, k); @@ -97,23 +115,24 @@ public class ItemInWorldManager { return true; } } - //CraftBukkit end + // CraftBukkit end int l = this.b.getTypeId(i, j, k); int i1 = this.b.getData(i, j, k); - boolean flag = this.b(i, j, k); - ItemStack itemstack = this.a.P(); + boolean flag = this.c(i, j, k); + ItemStack itemstack = this.a.z(); if (itemstack != null) { itemstack.a(l, i, j, k); if (itemstack.count == 0) { itemstack.a(this.a); - this.a.Q(); + this.a.A(); } } if (flag && this.a.b(Block.byId[l])) { - Block.byId[l].g(this.b, i, j, k, i1); + Block.byId[l].a_(this.b, i, j, k, i1); + ((EntityPlayer) this.a).a.b((Packet) (new Packet53BlockChange(i, j, k, this.b))); } return flag; |