mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-24 03:25:15 +01:00
Include anvil result in inventory size. Fixes BUKKIT-3741
This commit is contained in:
parent
af7ea28bc7
commit
a1c38cd8f3
@ -376,7 +376,7 @@ public class ContainerAnvil extends Container {
|
||||
return bukkitEntity;
|
||||
}
|
||||
|
||||
org.bukkit.craftbukkit.inventory.CraftInventory inventory = new org.bukkit.craftbukkit.inventory.CraftInventoryAnvil(this.g);
|
||||
org.bukkit.craftbukkit.inventory.CraftInventory inventory = new org.bukkit.craftbukkit.inventory.CraftInventoryAnvil(this.g, this.f);
|
||||
bukkitEntity = new CraftInventoryView(this.player.player.getBukkitEntity(), inventory, this);
|
||||
return bukkitEntity;
|
||||
}
|
||||
|
@ -4,7 +4,23 @@ import net.minecraft.server.IInventory;
|
||||
import org.bukkit.inventory.AnvilInventory;
|
||||
|
||||
public class CraftInventoryAnvil extends CraftInventory implements AnvilInventory {
|
||||
public CraftInventoryAnvil(IInventory anvil) {
|
||||
super(anvil);
|
||||
private final IInventory resultInventory;
|
||||
|
||||
public CraftInventoryAnvil(IInventory inventory, IInventory resultInventory) {
|
||||
super(inventory);
|
||||
this.resultInventory = resultInventory;
|
||||
}
|
||||
|
||||
public IInventory getResultInventory() {
|
||||
return resultInventory;
|
||||
}
|
||||
|
||||
public IInventory getIngredientsInventory() {
|
||||
return inventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSize() {
|
||||
return getResultInventory().getSize() + getIngredientsInventory().getSize();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user