Update to Minecraft 1.12-pre2

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2017-05-14 12:00:00 +10:00
parent b8446f770b
commit 40c8954e17
210 changed files with 2280 additions and 1974 deletions

View File

@@ -12,7 +12,7 @@
private static final EnumItemSlot[] h = new EnumItemSlot[] { EnumItemSlot.HEAD, EnumItemSlot.CHEST, EnumItemSlot.LEGS, EnumItemSlot.FEET};
@@ -7,10 +12,20 @@
public IInventory resultInventory = new InventoryCraftResult();
public InventoryCraftResult resultInventory = new InventoryCraftResult();
public boolean g;
private final EntityHuman owner;
+ // CraftBukkit start
@@ -50,32 +50,7 @@
}
public boolean isAllowed(EntityHuman entityhuman) {
@@ -54,11 +69,22 @@
this.a(new Slot(playerinventory, 40, 77, 62) {
});
- this.a((IInventory) this.craftInventory);
+ // this.a((IInventory) this.craftInventory); // CraftBukkit - unneeded since it just sets result slot to empty
}
public void a(IInventory iinventory) {
- this.resultInventory.setItem(0, CraftingManager.getInstance().craft(this.craftInventory, this.owner.world));
+ // this.resultInventory.setItem(0, CraftingManager.getInstance().craft(this.craftInventory, this.owner.world));
+ // CraftBukkit start (Note: the following line would cause an error if called during construction)
+ CraftingManager.getInstance().lastCraftView = getBukkitView();
+ ItemStack craftResult = CraftingManager.getInstance().craft(this.craftInventory, this.owner.world);
+ this.resultInventory.setItem(0, craftResult);
+ if (super.listeners.size() < 1) {
+ return;
+ }
+
+ EntityPlayer player = (EntityPlayer) super.listeners.get(0); // TODO: Is this _always_ correct? Seems like it.
+ player.playerConnection.sendPacket(new PacketPlayOutSetSlot(player.activeContainer.windowId, 0, craftResult));
+ // CraftBukkit end
}
public void b(EntityHuman entityhuman) {
@@ -148,4 +174,17 @@
@@ -141,4 +156,17 @@
public boolean a(ItemStack itemstack, Slot slot) {
return slot.inventory != this.resultInventory && super.a(itemstack, slot);
}