Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 12:30:06 +01:00
Include anvil result in inventory size. Fixes BUKKIT-3741
Dieser Commit ist enthalten in:
Ursprung
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren