Guest User

Untitled

a guest
May 22nd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.92 KB | None | 0 0
  1. public void sendBlockRemoving(int i, int j, int k, int l)
  2.     {
  3.         syncCurrentPlayItem();
  4.         if(blockHitDelay > 0)
  5.         {
  6.             blockHitDelay--;
  7.             return;
  8.         }
  9.         if(creativeMode)
  10.         {
  11.             blockHitDelay = 5;
  12.             netClientHandler.addToSendQueue(new Packet14BlockDig(0, i, j, k, l));
  13.             PlayerControllerCreative.func_35644_a(mc, this, i, j, k, l);
  14.             return;
  15.         }
  16.         if(i == currentBlockX && j == currentBlockY && k == currentblockZ)
  17.         {
  18.             int i1 = mc.theWorld.getBlockId(i, j, k);
  19.             if(i1 == 0)
  20.             {
  21.                 isHittingBlock = false;
  22.                 return;
  23.             }
  24.             Block block = Block.blocksList[i1];
  25.            
  26.             if(base.instant)
  27.             {
  28.            
  29.                 curBlockDamageMP += block.blockStrength(mc.thePlayer) * 90000;
  30.             } else
  31.             {
  32.                 curBlockDamageMP += block.blockStrength(mc.thePlayer);
  33.             }
  34.             if(stepSoundTickCounter % 4F == 0.0F && block != null)
  35.             {
  36.                 mc.sndManager.playSound(block.stepSound.stepSoundDir2(), (float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F, (block.stepSound.getVolume() + 1.0F) / 8F, block.stepSound.getPitch() * 0.5F);
  37.             }
  38.             stepSoundTickCounter++;
  39.             if(curBlockDamageMP >= 1.0F)
  40.             {
  41.                 isHittingBlock = false;
  42.                 netClientHandler.addToSendQueue(new Packet14BlockDig(2, i, j, k, l));
  43.                 if(!base.instant)
  44.                 {
  45.                     sendBlockRemoved(i, j, k, l);
  46.                 }
  47.                 curBlockDamageMP =  0.0F;
  48.                prevBlockDamageMP =0F;
  49.                stepSoundTickCounter =0F;
  50.                blockHitDelay = base.instant ? 0 : 10;
  51.             }
  52.         } else
  53.         {
  54.             clickBlock(i, j, k, l);
  55.         }
  56.     }
Add Comment
Please, Sign In to add comment