Search in sources :

Example 1 with CraftBlockInventoryHolder

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

the class ComposterBlock_EmptyInventoryMixin method arclight$constructor.

public void arclight$constructor(IWorld world, BlockPos blockPos) {
    arclight$constructor();
    this.setOwner(new CraftBlockInventoryHolder(world, blockPos, this));
}
Also used : CraftBlockInventoryHolder(org.bukkit.craftbukkit.v.inventory.CraftBlockInventoryHolder)

Example 2 with CraftBlockInventoryHolder

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

the class ComposterBlockMixin method arclight$newEmpty.

@SuppressWarnings("UnresolvedMixinReference")
@Redirect(method = "createInventory", at = @At(value = "NEW", target = "()Lnet/minecraft/block/ComposterBlock$EmptyInventory;"))
public ComposterBlock.EmptyInventory arclight$newEmpty(BlockState blockState, IWorld world, BlockPos blockPos) {
    ComposterBlock.EmptyInventory inventory = new ComposterBlock.EmptyInventory();
    ((IInventoryBridge) inventory).setOwner(new CraftBlockInventoryHolder(world, blockPos, inventory));
    return inventory;
}
Also used : ComposterBlock(net.minecraft.block.ComposterBlock) IInventoryBridge(io.izzel.arclight.common.bridge.inventory.IInventoryBridge) CraftBlockInventoryHolder(org.bukkit.craftbukkit.v.inventory.CraftBlockInventoryHolder) Redirect(org.spongepowered.asm.mixin.injection.Redirect)

Aggregations

CraftBlockInventoryHolder (org.bukkit.craftbukkit.v.inventory.CraftBlockInventoryHolder)2 IInventoryBridge (io.izzel.arclight.common.bridge.inventory.IInventoryBridge)1 ComposterBlock (net.minecraft.block.ComposterBlock)1 Redirect (org.spongepowered.asm.mixin.injection.Redirect)1