Search in sources :

Example 6 with PlayerEntityBridge

use of io.izzel.arclight.common.bridge.entity.player.PlayerEntityBridge in project Arclight by IzzelAliz.

the class BrewingStandContainerMixin method getBukkitView.

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

Example 7 with PlayerEntityBridge

use of io.izzel.arclight.common.bridge.entity.player.PlayerEntityBridge 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 PlayerEntityBridge

use of io.izzel.arclight.common.bridge.entity.player.PlayerEntityBridge 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 PlayerEntityBridge

use of io.izzel.arclight.common.bridge.entity.player.PlayerEntityBridge 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 PlayerEntityBridge

use of io.izzel.arclight.common.bridge.entity.player.PlayerEntityBridge 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

PlayerEntityBridge (io.izzel.arclight.common.bridge.entity.player.PlayerEntityBridge)20 Container (net.minecraft.inventory.container.Container)15 CraftInventoryView (org.bukkit.craftbukkit.v.inventory.CraftInventoryView)15 CraftInventory (org.bukkit.craftbukkit.v.inventory.CraftInventory)5 Player (org.bukkit.entity.Player)5 Overwrite (org.spongepowered.asm.mixin.Overwrite)5 EntityBridge (io.izzel.arclight.common.bridge.entity.EntityBridge)4 ServerPlayerEntityBridge (io.izzel.arclight.common.bridge.entity.player.ServerPlayerEntityBridge)4 MobEntity (net.minecraft.entity.MobEntity)3 PlayerInventory (net.minecraft.entity.player.PlayerInventory)3 ServerPlayerEntity (net.minecraft.entity.player.ServerPlayerEntity)3 LeashKnotEntity (net.minecraft.entity.item.LeashKnotEntity)2 PlayerEntity (net.minecraft.entity.player.PlayerEntity)2 IInventory (net.minecraft.inventory.IInventory)2 EnchantmentContainer (net.minecraft.inventory.container.EnchantmentContainer)2 ItemStack (net.minecraft.item.ItemStack)2 BlockPos (net.minecraft.util.math.BlockPos)2 HangingPlaceEvent (org.bukkit.event.hanging.HangingPlaceEvent)2 InternalEntityBridge (io.izzel.arclight.common.bridge.entity.InternalEntityBridge)1 PlayerInventoryBridge (io.izzel.arclight.common.bridge.entity.player.PlayerInventoryBridge)1