mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-02 11:22:01 +01:00
SPIGOT-7757: Cannot set item in Stonecutter Inventory
By: md_5 <git@md-5.net>
This commit is contained in:
parent
85df4599c9
commit
3e98b1bcbe
@ -229,7 +229,7 @@ public class CraftContainer extends Container {
|
||||
delegate = new ContainerGrindstone(windowId, bottom);
|
||||
break;
|
||||
case STONECUTTER:
|
||||
delegate = new ContainerStonecutter(windowId, bottom);
|
||||
setupStoneCutter(top, bottom); // SPIGOT-7757 - manual setup required for individual slots
|
||||
break;
|
||||
case MERCHANT:
|
||||
delegate = new ContainerMerchant(windowId, bottom);
|
||||
@ -328,6 +328,26 @@ public class CraftContainer extends Container {
|
||||
// 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
|
||||
public ItemStack quickMoveStack(EntityHuman entityhuman, int i) {
|
||||
return (delegate != null) ? delegate.quickMoveStack(entityhuman, i) : ItemStack.EMPTY;
|
||||
|
Loading…
Reference in New Issue
Block a user