Add method to access owner

Makes handling ISpecialInventory ownership much more consistent with a lot less spaghetti.
This commit is contained in:
Jikoo
2021-03-28 11:12:49 -04:00
parent 5b18656485
commit 6c4818dfd9
5 changed files with 20 additions and 3 deletions

View File

@@ -80,6 +80,11 @@ public class SpecialEnderChest extends InventoryEnderChest implements ISpecialEn
}
}
@Override
public @NotNull Player getPlayer() {
return owner.getBukkitEntity();
}
@Override
public void update() {
this.owner.getEnderChest().update();

View File

@@ -212,6 +212,11 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
this.playerOnline = false;
}
@Override
public @NotNull HumanEntity getPlayer() {
return this.player.getBukkitEntity();
}
@Override
public ItemStack splitStack(int i, final int j) {
List<ItemStack> list = this.items;