Update CraftBukkit to Minecraft 1.5.1

This commit is contained in:
Travis Watkins
2013-03-20 15:09:23 -05:00
parent 6aaa1e83df
commit 696543cf3f
21 changed files with 307 additions and 231 deletions

View File

@@ -10,11 +10,13 @@ import org.bukkit.event.inventory.BrewEvent;
public class TileEntityBrewingStand extends TileEntity implements IWorldInventory {
public ItemStack[] items = new ItemStack[4]; // CraftBukkit private -> public
public int brewTime; // CraftBukkit private -> public
private int c;
private int d;
private String e;
private static final int[] a = new int[] { 3};
private static final int[] b = 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;
public TileEntityBrewingStand() {}
@@ -44,15 +46,15 @@ public class TileEntityBrewingStand extends TileEntity implements IWorldInventor
// CraftBukkit end
public String getName() {
return this.c() ? this.e : "container.brewing";
return this.c() ? this.g : "container.brewing";
}
public boolean c() {
return this.e != null && this.e.length() > 0;
return this.g != null && this.g.length() > 0;
}
public void a(String s) {
this.e = s;
this.g = s;
}
public int getSize() {
@@ -68,19 +70,19 @@ public class TileEntityBrewingStand extends TileEntity implements IWorldInventor
} else if (!this.l()) {
this.brewTime = 0;
this.update();
} else if (this.d != this.items[3].id) {
} else if (this.f != this.items[3].id) {
this.brewTime = 0;
this.update();
}
} else if (this.l()) {
this.brewTime = 400;
this.d = this.items[3].id;
this.f = this.items[3].id;
}
int i = this.j();
if (i != this.c) {
this.c = i;
if (i != this.e) {
this.e = i;
this.world.setData(this.x, this.y, this.z, i, 2);
}
@@ -190,7 +192,7 @@ public class TileEntityBrewingStand extends TileEntity implements IWorldInventor
this.brewTime = nbttagcompound.getShort("BrewTime");
if (nbttagcompound.hasKey("CustomName")) {
this.e = nbttagcompound.getString("CustomName");
this.g = nbttagcompound.getString("CustomName");
}
}
@@ -211,7 +213,7 @@ public class TileEntityBrewingStand extends TileEntity implements IWorldInventor
nbttagcompound.set("Items", nbttaglist);
if (this.c()) {
nbttagcompound.setString("CustomName", this.e);
nbttagcompound.setString("CustomName", this.g);
}
}
@@ -275,11 +277,15 @@ public class TileEntityBrewingStand extends TileEntity implements IWorldInventor
return i;
}
public int c(int i) {
return i == 1 ? 3 : 0;
public int[] getSlotsForFace(int i) {
return i == 1 ? a : b;
}
public int d(int i) {
return i == 1 ? 1 : 3;
public boolean canPlaceItemThroughFace(int i, ItemStack itemstack, int j) {
return this.b(i, itemstack);
}
public boolean canTakeItemThroughFace(int i, ItemStack itemstack, int j) {
return true;
}
}