Search in sources :

Example 1 with CraftInventoryPlayer

use of org.bukkit.craftbukkit.v.inventory.CraftInventoryPlayer in project Arclight by IzzelAliz.

the class ChestContainerMixin method getBukkitView.

@Override
public CraftInventoryView getBukkitView() {
    if (bukkitEntity != null) {
        return bukkitEntity;
    }
    CraftInventory inventory;
    if (this.lowerChestInventory instanceof PlayerInventory) {
        inventory = new CraftInventoryPlayer((PlayerInventory) this.lowerChestInventory);
    } else if (this.lowerChestInventory instanceof DoubleSidedInventory) {
        inventory = new CraftInventoryDoubleChest((DoubleSidedInventory) this.lowerChestInventory);
    } else {
        inventory = new CraftInventory(this.lowerChestInventory);
    }
    bukkitEntity = new CraftInventoryView(((PlayerEntityBridge) this.playerInventory.player).bridge$getBukkitEntity(), inventory, (Container) (Object) this);
    return bukkitEntity;
}
Also used : CraftInventory(org.bukkit.craftbukkit.v.inventory.CraftInventory) DoubleSidedInventory(net.minecraft.inventory.DoubleSidedInventory) Container(net.minecraft.inventory.container.Container) ChestContainer(net.minecraft.inventory.container.ChestContainer) CraftInventoryView(org.bukkit.craftbukkit.v.inventory.CraftInventoryView) CraftInventoryPlayer(org.bukkit.craftbukkit.v.inventory.CraftInventoryPlayer) PlayerEntityBridge(io.izzel.arclight.common.bridge.entity.player.PlayerEntityBridge) PlayerInventory(net.minecraft.entity.player.PlayerInventory) CraftInventoryDoubleChest(org.bukkit.craftbukkit.v.inventory.CraftInventoryDoubleChest)

Aggregations

PlayerEntityBridge (io.izzel.arclight.common.bridge.entity.player.PlayerEntityBridge)1 PlayerInventory (net.minecraft.entity.player.PlayerInventory)1 DoubleSidedInventory (net.minecraft.inventory.DoubleSidedInventory)1 ChestContainer (net.minecraft.inventory.container.ChestContainer)1 Container (net.minecraft.inventory.container.Container)1 CraftInventory (org.bukkit.craftbukkit.v.inventory.CraftInventory)1 CraftInventoryDoubleChest (org.bukkit.craftbukkit.v.inventory.CraftInventoryDoubleChest)1 CraftInventoryPlayer (org.bukkit.craftbukkit.v.inventory.CraftInventoryPlayer)1 CraftInventoryView (org.bukkit.craftbukkit.v.inventory.CraftInventoryView)1