geforkt von Mirrors/Paper
Store owning Horse in horse inventory. Fixes BUKKIT-4586
Dieser Commit ist enthalten in:
Ursprung
0a9758ae54
Commit
5bfd599e9f
@ -328,7 +328,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
|||||||
public void cH() { // CraftBukkit - private -> public
|
public void cH() { // CraftBukkit - private -> public
|
||||||
InventoryHorseChest inventoryhorsechest = this.inventoryChest;
|
InventoryHorseChest inventoryhorsechest = this.inventoryChest;
|
||||||
|
|
||||||
this.inventoryChest = new InventoryHorseChest("HorseChest", this.cG());
|
this.inventoryChest = new InventoryHorseChest("HorseChest", this.cG(), this); // CraftBukkit - add this horse
|
||||||
this.inventoryChest.a(this.getLocalizedName());
|
this.inventoryChest.a(this.getLocalizedName());
|
||||||
if (inventoryhorsechest != null) {
|
if (inventoryhorsechest != null) {
|
||||||
inventoryhorsechest.b(this);
|
inventoryhorsechest.b(this);
|
||||||
|
@ -14,9 +14,14 @@ public class InventoryHorseChest extends InventorySubcontainer {
|
|||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
|
public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
|
||||||
public org.bukkit.entity.Player player;
|
private EntityHorse horse;
|
||||||
private int maxStack = MAX_STACK;
|
private int maxStack = MAX_STACK;
|
||||||
|
|
||||||
|
public InventoryHorseChest(String s, int i, EntityHorse horse) {
|
||||||
|
this(s, i);
|
||||||
|
this.horse = horse;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack[] getContents() {
|
public ItemStack[] getContents() {
|
||||||
return this.items;
|
return this.items;
|
||||||
@ -39,7 +44,7 @@ public class InventoryHorseChest extends InventorySubcontainer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public org.bukkit.inventory.InventoryHolder getOwner() {
|
public org.bukkit.inventory.InventoryHolder getOwner() {
|
||||||
return this.player;
|
return (org.bukkit.entity.Horse) this.horse.getBukkitEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren