Posted September 5, 201510 yr Im trying to set my custom rotation value of a TileEntity in the onBlockPlacedBy method of the block. But somehow the rotation keeps all the same. What i do atm is this: @Override public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { super.onBlockPlacedBy(worldIn, pos, state, placer, stack); TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof TileEntity_Electric){ TileEntity_Electric tile = (TileEntity_Electric)tileentity; tile.rotation = MathHelper.floor_double((double)(placer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; System.out.println("Succesfully rotated "+tile.getClass().getName()); } }
September 5, 201510 yr what do you mean "keeps all the same"? Is the syso with "sucesfully rotated" not printing what u expect? or are u calling the value elsewhere and getting only 0 as value? if u are getting only 0 as value, u should think of the fact that u need to sync the values between client and server.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.