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);
}
}
Aggregations