mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-18 13:53:49 -07:00
Include anvil result in inventory size. Fixes BUKKIT-3741
By: Travis Watkins <amaranth@ubuntu.com>
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user