Update CraftBukkit to Minecraft 1.3.1

This commit is contained in:
feildmaster
2012-07-29 02:33:13 -05:00
committed by Travis Watkins
parent 08e2923bd4
commit a43d621c01
240 changed files with 10763 additions and 9150 deletions

View File

@@ -1,5 +1,7 @@
package net.minecraft.server;
import java.util.Iterator;
// CraftBukkit start
import org.bukkit.craftbukkit.inventory.CraftInventory;
import org.bukkit.craftbukkit.inventory.CraftInventoryView;
@@ -8,7 +10,8 @@ import org.bukkit.craftbukkit.inventory.CraftInventoryView;
public class ContainerBrewingStand extends Container {
private TileEntityBrewingStand brewingStand;
private int b = 0;
private final Slot f;
private int g = 0;
// CraftBukkit start
private CraftInventoryView bukkitEntity = null;
private PlayerInventory player;
@@ -17,10 +20,10 @@ public class ContainerBrewingStand extends Container {
public ContainerBrewingStand(PlayerInventory playerinventory, TileEntityBrewingStand tileentitybrewingstand) {
player = playerinventory; // CraftBukkit
this.brewingStand = tileentitybrewingstand;
this.a(new SlotPotionBottle(this, playerinventory.player, tileentitybrewingstand, 0, 56, 46));
this.a(new SlotPotionBottle(this, playerinventory.player, tileentitybrewingstand, 1, 79, 53));
this.a(new SlotPotionBottle(this, playerinventory.player, tileentitybrewingstand, 2, 102, 46));
this.a(new SlotBrewing(this, tileentitybrewingstand, 3, 79, 17));
this.a(new SlotPotionBottle(playerinventory.player, tileentitybrewingstand, 0, 56, 46));
this.a(new SlotPotionBottle(playerinventory.player, tileentitybrewingstand, 1, 79, 53));
this.a(new SlotPotionBottle(playerinventory.player, tileentitybrewingstand, 2, 102, 46));
this.f = this.a(new SlotBrewing(this, tileentitybrewingstand, 3, 79, 17));
int i;
@@ -37,38 +40,47 @@ public class ContainerBrewingStand extends Container {
public void addSlotListener(ICrafting icrafting) {
super.addSlotListener(icrafting);
icrafting.setContainerData(this, 0, this.brewingStand.i());
icrafting.setContainerData(this, 0, this.brewingStand.t_());
}
public void a() {
super.a();
public void b() {
super.b();
Iterator iterator = this.listeners.iterator();
for (int i = 0; i < this.listeners.size(); ++i) {
ICrafting icrafting = (ICrafting) this.listeners.get(i);
while (iterator.hasNext()) {
ICrafting icrafting = (ICrafting) iterator.next();
if (this.b != this.brewingStand.i()) {
icrafting.setContainerData(this, 0, this.brewingStand.i());
if (this.g != this.brewingStand.t_()) {
icrafting.setContainerData(this, 0, this.brewingStand.t_());
}
}
this.b = this.brewingStand.i();
this.g = this.brewingStand.t_();
}
public boolean b(EntityHuman entityhuman) {
public boolean c(EntityHuman entityhuman) {
if (!this.checkReachable) return true; // CraftBukkit
return this.brewingStand.a(entityhuman);
}
public ItemStack a(int i) {
public ItemStack b(int i) {
ItemStack itemstack = null;
Slot slot = (Slot) this.e.get(i);
Slot slot = (Slot) this.b.get(i);
if (slot != null && slot.c()) {
if (slot != null && slot.d()) {
ItemStack itemstack1 = slot.getItem();
itemstack = itemstack1.cloneItemStack();
if ((i < 0 || i > 2) && i != 3) {
if (i >= 4 && i < 31) {
if (!this.f.d() && this.f.isAllowed(itemstack1)) {
if (!this.a(itemstack1, 3, 4, false)) {
return null;
}
} else if (SlotPotionBottle.a_(itemstack)) {
if (!this.a(itemstack1, 0, 3, false)) {
return null;
}
} else if (i >= 4 && i < 31) {
if (!this.a(itemstack1, 31, 40, false)) {
return null;
}
@@ -90,14 +102,14 @@ public class ContainerBrewingStand extends Container {
if (itemstack1.count == 0) {
slot.set((ItemStack) null);
} else {
slot.d();
slot.e();
}
if (itemstack1.count == itemstack.count) {
return null;
}
slot.c(itemstack1);
slot.b(itemstack1);
}
return itemstack;
@@ -108,6 +120,7 @@ public class ContainerBrewingStand extends Container {
if (bukkitEntity != null) {
return bukkitEntity;
}
CraftInventory inventory = new CraftInventory(this.brewingStand);
bukkitEntity = new CraftInventoryView(this.player.player.getBukkitEntity(), inventory, this);
return bukkitEntity;