Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.67 KB | None | 0 0
  1. public void handlePlace(Packet15Place packet15place)
  2.     {
  3.         ItemStack itemstack = playerEntity.inventory.getCurrentItem();
  4.         boolean flag = mcServer.worldMngr.field_819_z = mcServer.configManager.isOp(playerEntity.username);
  5.         if(packet15place.direction == 255)
  6.         {
  7.             if(itemstack == null)
  8.             {
  9.                 return;
  10.             }
  11.             playerEntity.field_425_ad.func_6154_a(playerEntity, mcServer.worldMngr, itemstack);
  12.         } else
  13.         {
  14.             int i = packet15place.xPosition;
  15.             int j = packet15place.yPosition;
  16.             int k = packet15place.zPosition;
  17.             int l = packet15place.direction;
  18.             int i1 = (int)MathHelper.abs(i - mcServer.worldMngr.spawnX);
  19.             int j1 = (int)MathHelper.abs(k - mcServer.worldMngr.spawnZ);
  20.             if(i1 > j1)
  21.             {
  22.                 j1 = i1;
  23.             }
  24.             if(j1 > 16 || flag)
  25.             {
  26.                 playerEntity.field_425_ad.func_327_a(playerEntity, mcServer.worldMngr, itemstack, i, j, k, l);
  27.             }
  28.             playerEntity.field_20908_a.sendPacket(new Packet53BlockChange(i, j, k, mcServer.worldMngr));
  29.             if(l == 0)
  30.             {
  31.                 j--;
  32.             }
  33.             if(l == 1)
  34.             {
  35.                 j++;
  36.             }
  37.             if(l == 2)
  38.             {
  39.                 k--;
  40.             }
  41.             if(l == 3)
  42.             {
  43.                 k++;
  44.             }
  45.             if(l == 4)
  46.             {
  47.                 i--;
  48.             }
  49.             if(l == 5)
  50.             {
  51.                 i++;
  52.             }
  53.             playerEntity.field_20908_a.sendPacket(new Packet53BlockChange(i, j, k, mcServer.worldMngr));
  54.         }
  55.         if(itemstack != null && itemstack.stackSize == 0)
  56.         {
  57.             playerEntity.inventory.mainInventory[playerEntity.inventory.currentItem] = null;
  58.         }
  59.         playerEntity.field_20064_am = true;
  60.         playerEntity.inventory.mainInventory[playerEntity.inventory.currentItem] = ItemStack.func_20117_a(playerEntity.inventory.mainInventory[playerEntity.inventory.currentItem]);
  61.         Slot slot = playerEntity.craftingInventory.func_20127_a(playerEntity.inventory, playerEntity.inventory.currentItem);
  62.         playerEntity.craftingInventory.func_20125_a();
  63.         playerEntity.field_20064_am = false;
  64.         if(!ItemStack.areItemStacksEqual(playerEntity.inventory.getCurrentItem(), packet15place.itemStack))
  65.         {
  66.             sendPacket(new Packet103(playerEntity.craftingInventory.windowId, slot.field_20100_c, playerEntity.inventory.getCurrentItem()));
  67.         }
  68.         mcServer.worldMngr.field_819_z = false;
  69.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement