diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-03-31 21:40:00 +0100 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-03-31 21:40:00 +0100 |
commit | 87c36febeb1801bc89ec040dd24db1ebac75ee36 (patch) | |
tree | 35bf16b0ebe4eb5ddb401d2e55391e3c85fc0f52 /src/main/java/net/minecraft/server/InventoryPlayer.java | |
parent | 0635f7c1b8b03c67bd3aa1a85514f7535cdf9168 (diff) | |
download | craftbukkit-87c36febeb1801bc89ec040dd24db1ebac75ee36.tar craftbukkit-87c36febeb1801bc89ec040dd24db1ebac75ee36.tar.gz craftbukkit-87c36febeb1801bc89ec040dd24db1ebac75ee36.tar.lz craftbukkit-87c36febeb1801bc89ec040dd24db1ebac75ee36.tar.xz craftbukkit-87c36febeb1801bc89ec040dd24db1ebac75ee36.zip |
Updated to Minecraft version 1.4
Diffstat (limited to 'src/main/java/net/minecraft/server/InventoryPlayer.java')
-rw-r--r-- | src/main/java/net/minecraft/server/InventoryPlayer.java | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/src/main/java/net/minecraft/server/InventoryPlayer.java b/src/main/java/net/minecraft/server/InventoryPlayer.java index 0ad40a0e..6029352e 100644 --- a/src/main/java/net/minecraft/server/InventoryPlayer.java +++ b/src/main/java/net/minecraft/server/InventoryPlayer.java @@ -5,9 +5,9 @@ public class InventoryPlayer implements IInventory { public ItemStack[] a = new ItemStack[36]; public ItemStack[] b = new ItemStack[4]; public int c = 0; - public EntityHuman e; // CraftBukkit - private->public + public EntityHuman d; // CraftBukkit - private->public private ItemStack f; - public boolean d = false; + public boolean e = false; // CraftBukkit start public ItemStack[] getContents() { @@ -20,15 +20,15 @@ public class InventoryPlayer implements IInventory { // CraftBukkit end public InventoryPlayer(EntityHuman entityhuman) { - this.e = entityhuman; + this.d = entityhuman; } public ItemStack b() { - if (this.c < this.a.length) { - return this.a[this.c]; - } else { - return null; - } + return this.c < 9 && this.c >= 0 ? this.a[this.c] : null; + } + + public static int e() { + return 9; } private int d(int i) { @@ -43,7 +43,7 @@ public class InventoryPlayer implements IInventory { private int c(ItemStack itemstack) { for (int i = 0; i < this.a.length; ++i) { - if (this.a[i] != null && this.a[i].id == itemstack.id && this.a[i].c() && this.a[i].count < this.a[i].b() && this.a[i].count < this.n_() && (!this.a[i].e() || this.a[i].h() == itemstack.h())) { + if (this.a[i] != null && this.a[i].id == itemstack.id && this.a[i].c() && this.a[i].count < this.a[i].b() && this.a[i].count < this.r_() && (!this.a[i].e() || this.a[i].h() == itemstack.h())) { return i; } } @@ -51,7 +51,7 @@ public class InventoryPlayer implements IInventory { return -1; } - private int j() { + private int k() { for (int i = 0; i < this.a.length; ++i) { if (this.a[i] == null) { return i; @@ -67,7 +67,7 @@ public class InventoryPlayer implements IInventory { int k = this.c(itemstack); if (k < 0) { - k = this.j(); + k = this.k(); } if (k < 0) { @@ -83,8 +83,8 @@ public class InventoryPlayer implements IInventory { l = this.a[k].b() - this.a[k].count; } - if (l > this.n_() - this.a[k].count) { - l = this.n_() - this.a[k].count; + if (l > this.r_() - this.a[k].count) { + l = this.r_() - this.a[k].count; } if (l == 0) { @@ -98,7 +98,7 @@ public class InventoryPlayer implements IInventory { } } - public void e() { + public void f() { for (int i = 0; i < this.a.length; ++i) { if (this.a[i] != null && this.a[i].b > 0) { --this.a[i].b; @@ -128,7 +128,7 @@ public class InventoryPlayer implements IInventory { } } - int i = this.j(); + int i = this.k(); if (i >= 0) { this.a[i] = itemstack; @@ -234,7 +234,7 @@ public class InventoryPlayer implements IInventory { } } - public int m_() { + public int q_() { return this.a.length + 4; } @@ -253,7 +253,7 @@ public class InventoryPlayer implements IInventory { return "Inventory"; } - public int n_() { + public int r_() { return 64; } @@ -273,7 +273,7 @@ public class InventoryPlayer implements IInventory { } } - public int f() { + public int g() { int i = 0; int j = 0; int k = 0; @@ -302,47 +302,47 @@ public class InventoryPlayer implements IInventory { public void c(int i) { for (int j = 0; j < this.b.length; ++j) { if (this.b[j] != null && this.b[j].a() instanceof ItemArmor) { - this.b[j].b(i); + this.b[j].a(i, this.d); if (this.b[j].count == 0) { - this.b[j].a(this.e); + this.b[j].a(this.d); this.b[j] = null; } } } } - public void g() { + public void h() { int i; for (i = 0; i < this.a.length; ++i) { if (this.a[i] != null) { - this.e.a(this.a[i], true); + this.d.a(this.a[i], true); this.a[i] = null; } } for (i = 0; i < this.b.length; ++i) { if (this.b[i] != null) { - this.e.a(this.b[i], true); + this.d.a(this.b[i], true); this.b[i] = null; } } } - public void h() { - this.d = true; + public void i() { + this.e = true; } public void b(ItemStack itemstack) { this.f = itemstack; - this.e.a(itemstack); + this.d.a(itemstack); } - public ItemStack i() { + public ItemStack j() { return this.f; } public boolean a_(EntityHuman entityhuman) { - return this.e.dead ? false : entityhuman.g(this.e) <= 64.0D; + return this.d.dead ? false : entityhuman.g(this.d) <= 64.0D; } } |