mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-24 17:22:55 +01:00
SPIGOT-2213: Fix custom anvil inventory
By: md_5 <git@md-5.net>
This commit is contained in:
parent
4b22260d42
commit
e622278811
1 changed files with 25 additions and 1 deletions
|
@ -143,6 +143,9 @@ public class CraftContainer extends Container {
|
|||
case HOPPER:
|
||||
setupHopper(top, bottom);
|
||||
break;
|
||||
case ANVIL:
|
||||
setupAnvil(top, bottom);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -241,7 +244,8 @@ public class CraftContainer extends Container {
|
|||
|
||||
private void setupEnchanting(IInventory top, IInventory bottom) {
|
||||
// This code copied from ContainerEnchantTable
|
||||
this.a((new Slot(top, 0, 25, 47)));
|
||||
this.a((new Slot(top, 0, 15, 47)));
|
||||
this.a((new Slot(top, 0, 35, 47)));
|
||||
|
||||
int row;
|
||||
|
||||
|
@ -300,6 +304,26 @@ public class CraftContainer extends Container {
|
|||
// End copy from ContainerHopper
|
||||
}
|
||||
|
||||
private void setupAnvil(IInventory top, IInventory bottom) {
|
||||
// This code copied from ContainerAnvil
|
||||
this.a(new Slot(top, 0, 27, 47));
|
||||
this.a(new Slot(top, 1, 76, 47));
|
||||
this.a(new Slot(top, 2, 134, 47));
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.a(new Slot(bottom, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.a(new Slot(bottom, i, 8 + i * 18, 142));
|
||||
}
|
||||
// End copy from ContainerAnvil
|
||||
}
|
||||
|
||||
public boolean a(EntityHuman entity) {
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue