Advertisement
Gamebuster

Puddles.sk v0.6.5

Aug 2nd, 2014
586
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.90 KB | None | 0 0
  1. #Version 0.6.5
  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. loop blocks above block at {_puddleLoc}:
  20. if loop-block is not air, leaves, water item, or flowing water:
  21. set {_valid.%loop-player%} to false
  22. else:
  23. set {_valid.%loop-player%} to false
  24. else:
  25. set {_valid.%loop-player%} to false
  26. if {_valid.%loop-player%} is true:
  27. set block at {_puddleLoc} to water
  28. set data value of block at {_puddleLoc} to 7
  29. if {puddle.debug} is on:
  30. message "Puddle added at %{_puddleLoc}%" to loop-player
  31. add {_puddleLoc} to {puddleLocations.%loop-player's world%::*}
  32.  
  33. every 1 second:
  34. loop worlds:
  35. if is raining or thundering in loop-world:
  36. set {_chance} to 1%
  37. else:
  38. set {_chance} to 20%
  39. chance of {_chance}:
  40. set {_loc} to a random location out of {puddleLocations.%loop-world%::*}
  41. if {_loc} is set:
  42. if block at {_loc} is water:
  43. if data value of block at {_loc} is 7:
  44. set block at {_loc} to air
  45. if {puddle.debug} is on:
  46. broadcast "Puddle removed at %{_loc}%"
  47. else if {puddle.debug} is on:
  48. broadcast "Puddle no longer exists at %{_loc}%"
  49. else if {puddle.debug} is on:
  50. broadcast "Puddle no longer exists at %{_loc}%"
  51. wait 1 tick
  52. remove all {_loc} from {puddleLocations.%loop-world%::*}
  53.  
  54. command /puddles [<text>] [<text="%command sender's world%">]:
  55. trigger:
  56. if player is an op:
  57. if argument 1 is "clear":
  58. if argument 2 is "all":
  59. loop worlds:
  60. loop {puddleLocations.%loop-world%::*}:
  61. set block at loop-value to air
  62. remove all loop-value from {puddleLocations.%loop-world%::*}
  63. else:
  64. loop {puddleLocations.%argument 2%::*}:
  65. set block at loop-value to air
  66. remove all loop-value from {puddleLocations.%argument 2%::*}
  67. else if argument 1 is "list":
  68. if argument 2 is "all":
  69. loop worlds:
  70. loop {puddleLocations.%loop-world%::*}:
  71. message "%loop-value% in world ""%loop-world%"""
  72. else:
  73. loop {puddleLocations.%argument 2 parsed as world%::*}:
  74. message "%loop-value%" to command sender
  75.  
  76. on physics:
  77. if event-block is water:
  78. if data value of event-block is 7:
  79. set {_persist} to false
  80. set {_loc} to event-block's location
  81. subtract 0.5 from the z-coordinate of {_loc}
  82. loop {puddleLocations.%event-world%::*}:
  83. if "%loop-value%" = "%{_loc}%":
  84. cancel the event
  85. set {_persist} to true
  86. if {puddle.debug} is true:
  87. if {_persist} is true:
  88. broadcast "Puddle persisting at %event-location%"
  89.  
  90. command /pdebug <boolean>:
  91. trigger:
  92. if command sender is an op:
  93. set {puddle.debug} to argument 1
  94.  
  95. command /rain:
  96. trigger:
  97. if command sender is an op:
  98. set weather to rain
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement