SPIGOT-6434: Smithing Table and Anvil inventories .getType() returns CRAFTING

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-04-25 08:34:44 +10:00
parent 93ddc2d863
commit 4d865daa32
3 changed files with 11 additions and 37 deletions

View File

@@ -1,37 +1,6 @@
--- a/net/minecraft/world/inventory/ContainerAnvilAbstract.java
+++ b/net/minecraft/world/inventory/ContainerAnvilAbstract.java
@@ -11,13 +11,7 @@
public abstract class ContainerAnvilAbstract extends Container {
protected final InventoryCraftResult resultInventory = new InventoryCraftResult();
- protected final IInventory repairInventory = new InventorySubcontainer(2) {
- @Override
- public void update() {
- super.update();
- ContainerAnvilAbstract.this.a((IInventory) this);
- }
- };
+ protected final IInventory repairInventory; // CraftBukkit - instantiate repairInventory in the constructor
protected final ContainerAccess containerAccess;
protected final EntityHuman player;
@@ -31,6 +25,15 @@
super(containers, i);
this.containerAccess = containeraccess;
this.player = playerinventory.player;
+ // CraftBukkit start
+ this.repairInventory = new InventoryCrafting(this, 1, 2, player) {
+ @Override
+ public void update() {
+ super.update();
+ ContainerAnvilAbstract.this.a((IInventory) this);
+ }
+ };
+ // CraftBukkit end
this.a(new Slot(this.repairInventory, 0, 27, 47));
this.a(new Slot(this.repairInventory, 1, 76, 47));
this.a(new Slot(this.resultInventory, 2, 134, 47) {
@@ -85,6 +88,7 @@
@@ -85,6 +85,7 @@
@Override
public boolean canUse(EntityHuman entityhuman) {