Skip to content

Instantly share code, notes, and snippets.

@StillManic
Created April 10, 2016 02:51
Show Gist options
  • Save StillManic/de017bd3744ef2c2d6bb7603e57e7e23 to your computer and use it in GitHub Desktop.
Save StillManic/de017bd3744ef2c2d6bb7603e57e7e23 to your computer and use it in GitHub Desktop.
@Override
public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) {
StructureLathe lathe = new StructureLathe(placer.getHorizontalFacing(), pos);
if (lathe.addComponentParts(world, null, lathe.getBoundingBox())) {
IBlockState retState = this.getDefaultState().withProperty(ContentBlocks.HORIZONTAL, placer.getHorizontalFacing());
world.setBlockState(pos, retState, 3);
((TileEntityLathe) world.getTileEntity(pos)).structureLathe = lathe;
return retState;
}
return Blocks.air.getDefaultState();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment