Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
- if(world.isRemote)
- return true;
- TESword te = (TESword)world.getTileEntity(pos);
- EnumSword modelState = te.getModel();
- modelState = modelState.next();
- IBlockState newState = state.withProperty(MODEL, modelState);
- world.setBlockState(pos, newState); // this creates a new TE for some reason
- te = (TESword)world.getTileEntity(pos);
- te.setModel(modelState);
- world.notifyBlockUpdate(pos, state, newState, 2);
- te.markDirty();
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement