mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 21:19:00 +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;
|
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);
|
bukkitEntity = new CraftInventoryView(this.player.player.getBukkitEntity(), inventory, this);
|
||||||
return bukkitEntity;
|
return bukkitEntity;
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,23 @@ import net.minecraft.server.IInventory;
|
|||||||
import org.bukkit.inventory.AnvilInventory;
|
import org.bukkit.inventory.AnvilInventory;
|
||||||
|
|
||||||
public class CraftInventoryAnvil extends CraftInventory implements AnvilInventory {
|
public class CraftInventoryAnvil extends CraftInventory implements AnvilInventory {
|
||||||
public CraftInventoryAnvil(IInventory anvil) {
|
private final IInventory resultInventory;
|
||||||
super(anvil);
|
|
||||||
|
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