Guest User

Untitled

a guest
Oct 20th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1. diff -rua old/ComputerCraft/dan200/turtle/shared/TileEntityTurtle.java new/ComputerCraft/dan200/turtle/shared/TileEntityTurtle.java
  2. --- old/ComputerCraft/dan200/turtle/shared/TileEntityTurtle.java 2012-06-14 12:46:38.000000000 +0200
  3. +++ new/ComputerCraft/dan200/turtle/shared/TileEntityTurtle.java 2012-06-14 22:30:20.000000000 +0200
  4. @@ -197,6 +197,19 @@
  5. /* 288 */ throw new UnsupportedOperationException();
  6. /* */ }
  7. /* */
  8. + public int getSelectedSlotId()
  9. + {
  10. + if (!mod_ComputerCraft.isMultiplayerClient()) {
  11. + synchronized (this.m_inventory) {
  12. + ItemStack itemstack = this.m_inventory[this.m_state.selectedSlot];
  13. + if (itemstack == null) return -1;
  14. + return itemstack.id;
  15. + }
  16. + }
  17. +
  18. + throw new UnsupportedOperationException();
  19. + }
  20. +
  21. /* */ public int getSelectedSlot()
  22. /* */ {
  23. /* 293 */ if (!mod_ComputerCraft.isMultiplayerClient()) {
  24. @@ -753,7 +766,19 @@
  25. /* */
  26. /* 854 */ return false;
  27. /* */ }
  28. -/* */
  29. +/* */
  30. + private boolean compare(int i)
  31. + {
  32. + int j = this.x + net.minecraft.server.Facing.b[i];
  33. + int k = this.y + net.minecraft.server.Facing.c[i];
  34. + int l = this.z + net.minecraft.server.facing.d[i];
  35. +
  36. + if (!isBlockInWorld(k)) return false;
  37. +
  38. + int id = getSelectedSlotId();
  39. + return id == this.world.getTypeId(j, k, l).id;
  40. + }
  41. +
  42. /* */ private void dropStack(ItemStack itemstack, int i) {
  43. /* 858 */ double d = this.x + 0.5D;
  44. /* 859 */ double d1 = this.y + 0.5D;
  45. @@ -966,6 +991,16 @@
  46. /* 1102 */ break;
  47. /* */ case 25:
  48. /* 1105 */ flag = detect(0);
  49. + break;
  50. + case 26:
  51. + flag = compare(this.m_clientState.dir);
  52. + break;
  53. + case 27:
  54. + flag = detect(1);
  55. + break;
  56. + case 28:
  57. + flag = detect(0);
  58. + break;
  59. /* */ }
  60. /* */
  61. /* */ }
  62. Only in new/ComputerCraft/dan200/turtle/shared: TileEntityTurtle.java~
Add Comment
Please, Sign In to add comment