Advertisement
Gamebuster

Puddles.sk v0.5.1

Aug 2nd, 2014
581
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.41 KB | None | 0 0
  1. #Version 0.5.1
  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 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, sand, any wood, any log, gravel, or stone bricks:
  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 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="%command sender's world%">]:
  55. trigger:
  56. if player is an op:
  57. if argument 1 is "clear":
  58. loop worlds:
  59. loop {puddleLocations.%loop-world%::*}:
  60. set block at loop-value to air
  61. remove all loop-value from {puddleLocations.%loop-world%::*}
  62. if player is an op:
  63. loop {puddleLocations.%argument 1% parsed as world::*}:
  64. message "%loop-value%" to command sender
  65.  
  66. on physics:
  67. if event-block is water:
  68. if data value of event-block is 7:
  69. set {_persist} to false
  70. set {_loc} to event-block's location
  71. subtract 0.5 from the z-coordinate of {_loc}
  72. loop {puddleLocations.%event-world%::*}:
  73. if "%loop-value%" = "%{_loc}%":
  74. cancel the event
  75. set {_persist} to true
  76. if {puddle.debug} is true:
  77. if {_persist} is true:
  78. broadcast "Puddle persisting at %event-location%"
  79.  
  80. command /pdebug <boolean>:
  81. trigger:
  82. if command sender is an op:
  83. set {puddle.debug} to argument 1
  84.  
  85. command /rain:
  86. trigger:
  87. if command sender is an op:
  88. set weather to rain
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement