mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-14 03:35:51 -07:00
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user