Search in sources :

Example 6 with CraftInventoryView

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

the class CartographyContainerMixin method getBukkitView.

@Override
public CraftInventoryView getBukkitView() {
    if (bukkitEntity != null) {
        return bukkitEntity;
    }
    CraftInventoryCartography inventory = new CraftInventoryCartography(this.tableInventory, this.field_217001_f);
    bukkitEntity = new CraftInventoryView(this.player, inventory, (Container) (Object) this);
    return bukkitEntity;
}
Also used : CartographyContainer(net.minecraft.inventory.container.CartographyContainer) Container(net.minecraft.inventory.container.Container) CraftInventoryView(org.bukkit.craftbukkit.v.inventory.CraftInventoryView) CraftInventoryCartography(org.bukkit.craftbukkit.v.inventory.CraftInventoryCartography)

Example 7 with CraftInventoryView

use of org.bukkit.craftbukkit.v.inventory.CraftInventoryView 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)

Example 8 with CraftInventoryView

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

the class HopperContainerMixin method getBukkitView.

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

Example 9 with CraftInventoryView

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

the class LoomContainerMixin method getBukkitView.

@Override
public CraftInventoryView getBukkitView() {
    if (bukkitEntity != null) {
        return bukkitEntity;
    }
    CraftInventoryLoom inventory = new CraftInventoryLoom(this.inputInventory, this.outputInventory);
    bukkitEntity = new CraftInventoryView(((PlayerEntityBridge) this.playerInventory.player).bridge$getBukkitEntity(), inventory, (Container) (Object) this);
    return bukkitEntity;
}
Also used : Container(net.minecraft.inventory.container.Container) LoomContainer(net.minecraft.inventory.container.LoomContainer) CraftInventoryView(org.bukkit.craftbukkit.v.inventory.CraftInventoryView) PlayerEntityBridge(io.izzel.arclight.common.bridge.entity.player.PlayerEntityBridge) CraftInventoryLoom(org.bukkit.craftbukkit.v.inventory.CraftInventoryLoom)

Example 10 with CraftInventoryView

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

the class PlayerContainerMixin method getBukkitView.

@Override
public CraftInventoryView getBukkitView() {
    if (bukkitEntity != null) {
        return bukkitEntity;
    }
    CraftInventoryCrafting inventory = new CraftInventoryCrafting(this.craftMatrix, this.craftResult);
    bukkitEntity = new CraftInventoryView(((PlayerEntityBridge) this.playerInventory.player).bridge$getBukkitEntity(), inventory, (Container) (Object) this);
    return bukkitEntity;
}
Also used : CraftInventoryCrafting(org.bukkit.craftbukkit.v.inventory.CraftInventoryCrafting) PlayerContainer(net.minecraft.inventory.container.PlayerContainer) Container(net.minecraft.inventory.container.Container) CraftInventoryView(org.bukkit.craftbukkit.v.inventory.CraftInventoryView) PlayerEntityBridge(io.izzel.arclight.common.bridge.entity.player.PlayerEntityBridge)

Aggregations

Container (net.minecraft.inventory.container.Container)16 CraftInventoryView (org.bukkit.craftbukkit.v.inventory.CraftInventoryView)16 PlayerEntityBridge (io.izzel.arclight.common.bridge.entity.player.PlayerEntityBridge)14 CraftInventory (org.bukkit.craftbukkit.v.inventory.CraftInventory)6 ServerPlayerEntityBridge (io.izzel.arclight.common.bridge.entity.player.ServerPlayerEntityBridge)2 PlayerInventory (net.minecraft.entity.player.PlayerInventory)2 CraftInventoryCrafting (org.bukkit.craftbukkit.v.inventory.CraftInventoryCrafting)2 HashSet (java.util.HashSet)1 PlayerEntity (net.minecraft.entity.player.PlayerEntity)1 ServerPlayerEntity (net.minecraft.entity.player.ServerPlayerEntity)1 CraftResultInventory (net.minecraft.inventory.CraftResultInventory)1 DoubleSidedInventory (net.minecraft.inventory.DoubleSidedInventory)1 IInventory (net.minecraft.inventory.IInventory)1 AbstractFurnaceContainer (net.minecraft.inventory.container.AbstractFurnaceContainer)1 BeaconContainer (net.minecraft.inventory.container.BeaconContainer)1 BrewingStandContainer (net.minecraft.inventory.container.BrewingStandContainer)1 CartographyContainer (net.minecraft.inventory.container.CartographyContainer)1 ChestContainer (net.minecraft.inventory.container.ChestContainer)1 DispenserContainer (net.minecraft.inventory.container.DispenserContainer)1 EnchantmentContainer (net.minecraft.inventory.container.EnchantmentContainer)1