SPIGOT-7757: Cannot set item in Stonecutter Inventory
This commit is contained in:
parent
f8be9d7521
commit
eb9a7dde02
@ -229,7 +229,7 @@ public class CraftContainer extends Container {
|
|||||||
delegate = new ContainerGrindstone(windowId, bottom);
|
delegate = new ContainerGrindstone(windowId, bottom);
|
||||||
break;
|
break;
|
||||||
case STONECUTTER:
|
case STONECUTTER:
|
||||||
delegate = new ContainerStonecutter(windowId, bottom);
|
setupStoneCutter(top, bottom); // SPIGOT-7757 - manual setup required for individual slots
|
||||||
break;
|
break;
|
||||||
case MERCHANT:
|
case MERCHANT:
|
||||||
delegate = new ContainerMerchant(windowId, bottom);
|
delegate = new ContainerMerchant(windowId, bottom);
|
||||||
@ -328,6 +328,26 @@ public class CraftContainer extends Container {
|
|||||||
// End copy from ContainerSmithing
|
// End copy from ContainerSmithing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setupStoneCutter(IInventory top, IInventory bottom) {
|
||||||
|
// This code copied from ContainerStonecutter
|
||||||
|
this.addSlot(new Slot(top, 0, 20, 33));
|
||||||
|
this.addSlot(new Slot(top, 1, 143, 33));
|
||||||
|
|
||||||
|
int row;
|
||||||
|
int col;
|
||||||
|
|
||||||
|
for (row = 0; row < 3; ++row) {
|
||||||
|
for (col = 0; col < 9; ++col) {
|
||||||
|
this.addSlot(new Slot(bottom, col + row * 9 + 9, 8 + col * 18, 84 + row * 18));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (row = 0; row < 9; ++row) {
|
||||||
|
this.addSlot(new Slot(bottom, row, 8 + row * 18, 142));
|
||||||
|
}
|
||||||
|
// End copy from ContainerSmithing
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack quickMoveStack(EntityHuman entityhuman, int i) {
|
public ItemStack quickMoveStack(EntityHuman entityhuman, int i) {
|
||||||
return (delegate != null) ? delegate.quickMoveStack(entityhuman, i) : ItemStack.EMPTY;
|
return (delegate != null) ? delegate.quickMoveStack(entityhuman, i) : ItemStack.EMPTY;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user