Jump to content

fitty_spenc

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by fitty_spenc

  1. Yup it sure does, but if it works it don't need fixing
  2. Got it to work, I needed to have it happen on both the server and client side so I removed the if(!world.isRemote) that surrounds the entire thing and adjusted my counter because the function gets called twice for every individual click. ItemMagicStick.java
  3. I am creating a mod that destroys blocks between two points, but when I use it in game, the blocks that get destroyed aren't actually disappearing until I log out and back in again. I am pretty new to modding but I believe it is caused by some disconnect between server and client. Anyone know how to fix this? I attached the whole file but here is the snippet where I am doing the destruction: int sX = 1, sY = 1, sZ = 1; if (((int)(posA[1].getX()) - (int)(posA[0].getX())) > 0) sX = -1; if (((int)(posA[1].getY()) - (int)(posA[0].getY())) > 0) sY = -1; if (((int)(posA[1].getZ()) - (int)(posA[0].getZ())) > 0) sZ = -1; for (int i = 0; i <= Math.abs((int)(posA[1].getX()) - (int)(posA[0].getX())); i++ ){ for (int j = 0; j <= Math.abs((int)(posA[1].getY()) - (int)(posA[0].getY())); j++ ){ for (int k = 0; k <= Math.abs((int)(posA[1].getZ()) - (int)(posA[0].getZ())); k++ ){ //somehow need to refresh client from server side for each block being destroyed worldIn.destroyBlock(new BlockPos(i * sX + posA[1].getX(), j * sY + posA[1].getY(), k * sZ + posA[1].getZ()), true); worldIn.scheduleBlockUpdate(new BlockPos(i * sX + posA[1].getX(), j * sY + posA[1].getY(), k * sZ + posA[1].getZ()), Blocks.AIR, Blocks.AIR.tickRate(worldIn), 0); player.sendMessage(new TextComponentString("rm block " + (i * sX + posA[1].getX()) + " " + (j * sY + posA[1].getY()) + " " + (k * sZ + posA[1].getZ()))); } } } ItemMagicStick.java
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.