Advertisement
Gamebuster

Puddles.sk v1.0.0

Aug 3rd, 2014
529
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.82 KB | None | 0 0
  1. #Version 1.0.0
  2. #In order to download or use this software, you must agree to it's license: http://pastebin.com/raw.php?i=JGSLhFdU
  3.  
  4. every 1 tick:
  5. loop players:
  6. if is raining or thundering in loop-player's world:
  7. set {_valid.%loop-player%} to true
  8. set {_loc} to location of loop-player
  9. set {_horizontalX} to a random integer between (-100 + loop-player's location's x-coordinate) and (100 + loop-player's location's x-coordinate)
  10. set {_horizontalZ} to a random integer between (-100 + loop-player's location's z-coordinate) and (100 + loop-player's location's z-coordinate)
  11. set {_vertical} to a random integer between (-20 + loop-player's location's y-coordinate) and (20 + loop-player's location's y-coordinate)
  12. set {_world} to loop-player's world
  13. set {_puddleLoc} to loop-player's location
  14. set the x-coordinate of {_puddleLoc} to {_horizontalX} - 0.5
  15. set the y-coordinate of {_puddleLoc} to {_vertical} - 0.5
  16. set the z-coordinate of {_puddleLoc} to {_horizontalZ}
  17. if block at {_puddleLoc} is air:
  18. if block below {_puddleLoc} is dirt, stone, grass, cobblestone, bedrock, any sand, any wood, any log, gravel, any stone bricks, coal ore, iron ore, redstone ore, gold ore, emerald ore, diamond ore, or lapis ore:
  19. if biome at {_puddleLoc} is Desert, Desert Mountains, Desert Hills, Savanna, Savanna Mountains, Savanna Plateau, Savanna Plateau Mountains, Mesa, Mesa Bryce, Mesa Plateau, Mesa Plateau Mountains, Mesa Plateau forest, Mesa Plateau forest mountains, Cold Taiga, Cold Taiga Mountains, Cold Taiga Hills, Ice Plains, Ice Plains Spikes, Ice Mountains, Cold Beach, Frozen River, or hell:
  20. set {_valid.%loop-player%} to false
  21. else if biome at {_puddleLoc} is Extreme Hills, Extreme Hills Mountains, Extreme Hills Plus, or Extreme Hills Plus Mountains:
  22. if {_vertical} >= 93:
  23. set {_valid.%loop-player%} to false
  24. loop blocks above block at {_puddleLoc}:
  25. if loop-block is not air, leaves, water item, or flowing water:
  26. set {_valid.%loop-player%} to false
  27. else:
  28. set {_valid.%loop-player%} to false
  29. else:
  30. set {_valid.%loop-player%} to false
  31. if {_valid.%loop-player%} is true:
  32. set block at {_puddleLoc} to water
  33. set data value of block at {_puddleLoc} to 7
  34. if {puddle.debug} is on:
  35. message "Puddle added at %{_puddleLoc}%" to loop-player
  36. add {_puddleLoc} to {puddleLocations.%loop-player's world%::*}
  37.  
  38. every 1 second:
  39. loop worlds:
  40. set {_chance} to 20%
  41. if is raining in loop-world:
  42. if time in loop-world is between 20:00 and 8:00:
  43. set {_chance} to {_chance} * 0.25
  44. else if time in loop-world is between 11:00 and 16:00:
  45. set {_chance} to {_chance} * 0.75
  46. else:
  47. set {_chance} to {_chance} * 0.50
  48. else if is thundering in loop-world:
  49. if time in loop-world is between 20:00 and 8:00:
  50. set {_chance} to {_chance} * 0.05
  51. if time in loop-world is between 11:00 and 16:00:
  52. set {_chance} to {_chance} * 0.2
  53. else:
  54. set {_chance} to {_chance} * 0.1
  55. else if is sunny in loop-world:
  56. if time in loop-world is between 20:00 and 8:00:
  57. set {_chance} to {_chance} * 0.9
  58. else if time in loop-world is between 11:00 and 16:00:
  59. set {_chance} to {_chance} * 1.2
  60. else:
  61. set {_chance} to {_chance} * 1
  62.  
  63. else:
  64. set {_chance} to 20%
  65. chance of {_chance}:
  66. set {_loc} to a random location out of {puddleLocations.%loop-world%::*}
  67. if {_loc} is set:
  68. if block at {_loc} is water:
  69. if data value of block at {_loc} is 7:
  70. set block at {_loc} to air
  71. if {puddle.debug} is on:
  72. broadcast "Puddle removed at %{_loc}%"
  73. else if {puddle.debug} is on:
  74. broadcast "Puddle no longer exists at %{_loc}%"
  75. else if {puddle.debug} is on:
  76. broadcast "Puddle no longer exists at %{_loc}%"
  77. wait 1 tick
  78. remove all {_loc} from {puddleLocations.%loop-world%::*}
  79.  
  80. command /puddles [<text>] [<text="%command sender's world%">]:
  81. aliases: /puddle
  82. trigger:
  83. if player is an op:
  84. if argument 1 is "clear":
  85. if argument 2 is "all":
  86. loop worlds:
  87. loop {puddleLocations.%loop-world%::*}:
  88. set block at loop-value to air
  89. remove all loop-value from {puddleLocations.%loop-world%::*}
  90. message "<light red>Cleared all puddles in all worlds..."
  91. else if argument 2 is not "all":
  92. loop {puddleLocations.%argument 2%::*}:
  93. set block at loop-value to air
  94. remove all loop-value from {puddleLocations.%argument 2%::*}
  95. message "<light red>Cleared all puddles in world ""%argument 2%"""
  96. else if argument 1 is "list":
  97. if argument 2 is "all":
  98. set {_amt} to 0
  99. loop worlds:
  100. loop {puddleLocations.%loop-world%::*}:
  101. add 1 to {_amt}
  102. message "(%{_amt}%). %loop-value% in world ""%loop-world%"""
  103. else:
  104. set {_amt} to 0
  105. loop {puddleLocations.%argument 2%::*}:
  106. add 1 to {_amt}
  107. message "(%{_amt}%). %loop-value%" to command sender
  108. message "<light green>Listed all puddles in world ""%argument 2%"""
  109. else:
  110. message "<light red>/puddles <clear|list> [<world|all>]"
  111. else:
  112. message "<red>You do not have permission to do this"
  113.  
  114. on physics:
  115. if event-block is water:
  116. if data value of event-block is 7:
  117. set {_persist} to false
  118. set {_loc} to event-block's location
  119. subtract 0.5 from the z-coordinate of {_loc}
  120. loop {puddleLocations.%event-world%::*}:
  121. if "%loop-value%" = "%{_loc}%":
  122. cancel the event
  123. set {_persist} to true
  124. if {puddle.debug} is true:
  125. if {_persist} is true:
  126. broadcast "Puddle persisting at %event-location%"
  127.  
  128. command /pdebug <boolean>:
  129. trigger:
  130. if command sender is an op:
  131. set {puddle.debug} to argument 1
  132.  
  133. command /rain:
  134. trigger:
  135. if command sender is an op:
  136. set weather to rain
  137.  
  138. command /biome:
  139. trigger:
  140. message "%biome of command sender%"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement