Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1. function islandTreeDir(l: location) :: location:
  2. set {_v} to new vector from yaw (360 or 270 or 180 or 90) and pitch 0
  3. set normal length of {_v} to 1
  4. set {_l} to ({_l} ~ {_v})
  5. #------
  6. return {_l}
  7.  
  8.  
  9. function islandTree(l: location):
  10. set block at {_l} and block 1 meter above {_l} to spruce log
  11. set {_l} to location of block 1 meter above {_l}
  12. loop 3 times:
  13. set {_l} to islandTreeDir({_l})
  14. set block at {_l} and block 1 meter above {_l} to spruce log
  15. set {_l} to location 1 meter above {_l}
  16. #-------------
  17. set {_l} to block above {_l}
  18. loop blocks in radius 3 of {_l}:
  19. set {_h} to difference between y-coord of {_l} and y-coord of loop-block
  20. {_h} <= 0
  21. loop-block is air
  22. set loop-block to spruce leaves
  23. loop blocks in radius 2 of {_l}:
  24. set {_h} to difference between y-coord of {_l} and y-coord of loop-block
  25. {_h} = 1
  26. loop-block is air
  27. set loop-block to spruce leaves
  28.  
  29.  
  30.  
  31. function islandspawn(l: location):
  32. loop blocks in radius 4 of {_l}:
  33. y-coord of loop-block <= y-coord of {_l}:
  34. set loop-block to grass block or grass path
  35. islandTree({_l})
  36. loop blocks in radius 3 of {_l}:
  37. loop-block is grass block or grass path
  38. block 1 meter above loop-block is air
  39. set block 1 meter above loop-block to barrel
  40. stop
  41.  
  42.  
  43.  
  44.  
  45. #-------//////--------
  46. # Code split
  47. #-------//////--------
  48.  
  49.  
  50. function dir(l: location, c: integer) :: location:
  51. set {_v} to new vector from yaw {_c} and pitch 0
  52. set normal length of {_v} to 200
  53. set {_l} to ({_l} ~ {_v})
  54. #------
  55. return {_l}
  56.  
  57.  
  58.  
  59. function checkforNEWisland(p: player):
  60. set {_baseloc} to location at 100, 70, 100 in world "world"
  61. set {_l} to {_baseloc}
  62. set {_angle} to 90
  63. set {_CheckIsland} to true
  64. set {_baseNumber} to 0
  65. set {_baseC} to 4
  66. set {_turn} to 1
  67. #------------------------------
  68. while {_CheckIsland} is true:
  69. add 1 to {_IFturn}
  70. {_baseNumber} = {_baseC}:
  71. set {_baseNumber} to 0
  72. add 2 to {_turn}
  73. add 8 to {_baseC}
  74. add 5 to x-coord of {_l}
  75. add 5 to z-coord of {_l}
  76. #------------
  77. {_IFturn} = {_turn}:
  78. add 90 to {_angle}
  79. set {_IFturn} to 0
  80. {_angle} = 360:
  81. set {_angle} to 0
  82. #------------
  83. set {_l} to dir({_l}, {_angle})
  84. block at {_l} = air:
  85. islandspawn({_l})
  86. loop blocks in radius 5 of {_l}:
  87. loop-block is grass block or grass path:
  88. teleport {_p} to block 1 meter above loop-block
  89. set {island::%{_p}%} to location of block at {_p}
  90. send " &cPlease reset your island spawn point!" to {_p}
  91. send " &7Use the command &3/island" to {_p}
  92. delete {_CheckIsland}
  93. stop
  94. #---------
  95. add 1 to {_baseNumber}
  96.  
  97.  
  98.  
  99. command /t:
  100. trigger:
  101. checkforNEWisland(player)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement