Update CraftBukkit to Minecraft 1.7.2

This commit is contained in:
mbax
2013-11-04 07:07:38 -06:00
committed by Wesley Wolfe
parent ff8b70fbb7
commit 2726696652
349 changed files with 14339 additions and 11287 deletions

View File

@@ -11,12 +11,12 @@ import org.bukkit.event.inventory.BrewEvent;
public class TileEntityBrewingStand extends TileEntity implements IWorldInventory {
private static final int[] a = new int[] { 3};
private static final int[] b = new int[] { 0, 1, 2};
private static final int[] i = new int[] { 0, 1, 2};
public ItemStack[] items = new ItemStack[4]; // CraftBukkit - private -> public
public int brewTime; // CraftBukkit - private -> public
private int e;
private int f;
private String g;
private int l;
private Item m;
private String n;
private int lastTick = MinecraftServer.currentTick; // CraftBukkit
public TileEntityBrewingStand() {}
@@ -46,16 +46,16 @@ public class TileEntityBrewingStand extends TileEntity implements IWorldInventor
}
// CraftBukkit end
public String getName() {
return this.c() ? this.g : "container.brewing";
public String getInventoryName() {
return this.k_() ? this.n : "container.brewing";
}
public boolean c() {
return this.g != null && this.g.length() > 0;
public boolean k_() {
return this.n != null && this.n.length() > 0;
}
public void a(String s) {
this.g = s;
this.n = s;
}
public int getSize() {
@@ -71,55 +71,55 @@ public class TileEntityBrewingStand extends TileEntity implements IWorldInventor
this.brewTime -= elapsedTicks;
if (this.brewTime <= 0) { // == -> <=
// CraftBukkit end
this.u();
this.l();
this.update();
} else if (!this.l()) {
} else if (!this.k()) {
this.brewTime = 0;
this.update();
} else if (this.f != this.items[3].id) {
} else if (this.m != this.items[3].getItem()) {
this.brewTime = 0;
this.update();
}
} else if (this.l()) {
} else if (this.k()) {
this.brewTime = 400;
this.f = this.items[3].id;
this.m = this.items[3].getItem();
}
int i = this.j();
if (i != this.e) {
this.e = i;
if (i != this.l) {
this.l = i;
this.world.setData(this.x, this.y, this.z, i, 2);
}
super.h();
}
public int x_() {
public int i() {
return this.brewTime;
}
private boolean l() {
private boolean k() {
if (this.items[3] != null && this.items[3].count > 0) {
ItemStack itemstack = this.items[3];
if (!Item.byId[itemstack.id].x()) {
if (!itemstack.getItem().m(itemstack)) {
return false;
} else {
boolean flag = false;
for (int i = 0; i < 3; ++i) {
if (this.items[i] != null && this.items[i].id == Item.POTION.id) {
if (this.items[i] != null && this.items[i].getItem() == Items.POTION) {
int j = this.items[i].getData();
int k = this.c(j, itemstack);
if (!ItemPotion.f(j) && ItemPotion.f(k)) {
if (!ItemPotion.g(j) && ItemPotion.g(k)) {
flag = true;
break;
}
List list = Item.POTION.c(j);
List list1 = Item.POTION.c(k);
List list = Items.POTION.c(j);
List list1 = Items.POTION.c(k);
if ((j <= 0 || list != list1) && (list == null || !list.equals(list1) && list1 != null) && j != k) {
flag = true;
@@ -135,8 +135,8 @@ public class TileEntityBrewingStand extends TileEntity implements IWorldInventor
}
}
private void u() {
if (this.l()) {
private void l() {
if (this.k()) {
ItemStack itemstack = this.items[3];
// CraftBukkit start
@@ -150,24 +150,24 @@ public class TileEntityBrewingStand extends TileEntity implements IWorldInventor
// CraftBukkit end
for (int i = 0; i < 3; ++i) {
if (this.items[i] != null && this.items[i].id == Item.POTION.id) {
if (this.items[i] != null && this.items[i].getItem() == Items.POTION) {
int j = this.items[i].getData();
int k = this.c(j, itemstack);
List list = Item.POTION.c(j);
List list1 = Item.POTION.c(k);
List list = Items.POTION.c(j);
List list1 = Items.POTION.c(k);
if ((j <= 0 || list != list1) && (list == null || !list.equals(list1) && list1 != null)) {
if (j != k) {
this.items[i].setData(k);
}
} else if (!ItemPotion.f(j) && ItemPotion.f(k)) {
} else if (!ItemPotion.g(j) && ItemPotion.g(k)) {
this.items[i].setData(k);
}
}
}
if (Item.byId[itemstack.id].u()) {
this.items[3] = new ItemStack(Item.byId[itemstack.id].t());
if (itemstack.getItem().u()) {
this.items[3] = new ItemStack(itemstack.getItem().t());
} else {
--this.items[3].count;
if (this.items[3].count <= 0) {
@@ -178,17 +178,17 @@ public class TileEntityBrewingStand extends TileEntity implements IWorldInventor
}
private int c(int i, ItemStack itemstack) {
return itemstack == null ? i : (Item.byId[itemstack.id].x() ? PotionBrewer.a(i, Item.byId[itemstack.id].w()) : i);
return itemstack == null ? i : (itemstack.getItem().m(itemstack) ? PotionBrewer.a(i, itemstack.getItem().i(itemstack)) : i);
}
public void a(NBTTagCompound nbttagcompound) {
super.a(nbttagcompound);
NBTTagList nbttaglist = nbttagcompound.getList("Items");
NBTTagList nbttaglist = nbttagcompound.getList("Items", 10);
this.items = new ItemStack[this.getSize()];
for (int i = 0; i < nbttaglist.size(); ++i) {
NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbttaglist.get(i);
NBTTagCompound nbttagcompound1 = nbttaglist.get(i);
byte b0 = nbttagcompound1.getByte("Slot");
if (b0 >= 0 && b0 < this.items.length) {
@@ -197,8 +197,8 @@ public class TileEntityBrewingStand extends TileEntity implements IWorldInventor
}
this.brewTime = nbttagcompound.getShort("BrewTime");
if (nbttagcompound.hasKey("CustomName")) {
this.g = nbttagcompound.getString("CustomName");
if (nbttagcompound.hasKeyOfType("CustomName", 8)) {
this.n = nbttagcompound.getString("CustomName");
}
}
@@ -218,8 +218,8 @@ public class TileEntityBrewingStand extends TileEntity implements IWorldInventor
}
nbttagcompound.set("Items", nbttaglist);
if (this.c()) {
nbttagcompound.setString("CustomName", this.g);
if (this.k_()) {
nbttagcompound.setString("CustomName", this.n);
}
}
@@ -265,10 +265,10 @@ public class TileEntityBrewingStand extends TileEntity implements IWorldInventor
public void startOpen() {}
public void g() {}
public void l_() {}
public boolean b(int i, ItemStack itemstack) {
return i == 3 ? Item.byId[itemstack.id].x() : itemstack.id == Item.POTION.id || itemstack.id == Item.GLASS_BOTTLE.id;
return i == 3 ? itemstack.getItem().m(itemstack) : itemstack.getItem() == Items.POTION || itemstack.getItem() == Items.GLASS_BOTTLE;
}
public int j() {
@@ -284,7 +284,7 @@ public class TileEntityBrewingStand extends TileEntity implements IWorldInventor
}
public int[] getSlotsForFace(int i) {
return i == 1 ? a : b;
return i == 1 ? a : TileEntityBrewingStand.i; // CraftBukkit - decompilation error
}
public boolean canPlaceItemThroughFace(int i, ItemStack itemstack, int j) {