Search in sources :

Example 1 with BlockLadder

use of net.minecraft.block.BlockLadder in project minecolonies by Minecolonies.

the class EntityAIStructureMiner method setBlockFromInventory.

private void setBlockFromInventory(@NotNull final BlockPos location, final Block block, final IBlockState metadata) {
    final int slot;
    if (block instanceof BlockLadder) {
        slot = worker.findFirstSlotInInventoryWith(block, -1);
    } else {
        slot = worker.findFirstSlotInInventoryWith(block, block.getMetaFromState(metadata));
    }
    if (slot != -1) {
        new InvWrapper(getInventory()).extractItem(slot, 1, false);
        //Flag 1+2 is needed for updates
        world.setBlockState(location, metadata, 0x03);
    }
}
Also used : InvWrapper(net.minecraftforge.items.wrapper.InvWrapper) BlockLadder(net.minecraft.block.BlockLadder)

Aggregations

BlockLadder (net.minecraft.block.BlockLadder)1 InvWrapper (net.minecraftforge.items.wrapper.InvWrapper)1