Advertisement
Gamebuster

Puddles.sk v1.6.0.1

Feb 22nd, 2015
618
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.92 KB | None | 0 0
  1. #Version 1.6.0.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. #Edit options and aliases to customize the skript
  4.  
  5. options:
  6. rangeXZ : 100 #The distance on both horizontal axes in which puddles can form
  7. rangeY : 20 #The distance on the Y axis in which puddles can form
  8. #COMMENT FOR BELOW OPTION #The list of biomes that puddles cannot form in, make sure you have OR and not AND at the end
  9. disallowed biome : 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
  10.  
  11. aliases:
  12. #USE NUMERICAL BLOCK IDS FOR THIS LIST
  13. #
  14. #
  15. #
  16. #LANDONABLE-Blocks that puddles can land on
  17. #FALLTHROUGHABLE-Blocks that puddles can form under
  18. #REPLACEABLE-Blocks that puddles can replace
  19. landonable = 1, 2, 3, 4, 7, 12, 5, 17, 162, 13, 97, 98, 16, 15, 73, 14, 129, 56, 21
  20. fallthroughable = 0, 18, 161, 8, 9, 175
  21. replaceable = 0, 31, 32, 37, 38, 78:0, 175, #55 #(redstone not replaceable by default)
  22.  
  23. every 1 tick:
  24. loop players:
  25. if is raining or thundering in loop-player's world:
  26. if {puddles.blacklist::*} contains loop-player's world:
  27. stop
  28. else:
  29. set {_valid.%loop-player%} to true
  30. set {_loc} to location of block at loop-player
  31. add a random integer between -{@rangeXZ} and {@rangeXZ} to {_loc}'s x-coordinate
  32. add a random integer between -{@rangeXZ} and {@rangeXZ} to {_loc}'s z-coordinate
  33. add a random integer between -{@rangeY} and {@rangeY} to {_loc}'s y-coordinate
  34. #broadcast "%{_loc}%"
  35. set {_world} to loop-player's world
  36. set {_puddleLoc} to location of block at {_loc}
  37. if block at {_puddleLoc} is replaceable:
  38. if block below {_puddleLoc} is landonable:
  39. if biome at {_puddleLoc} is {@disallowed biome}:
  40. set {_valid.%loop-player%} to false
  41. else if biome at {_puddleLoc} is Extreme Hills, Extreme Hills Mountains, Extreme Hills Plus, or Extreme Hills Plus Mountains:
  42. if {_vertical} >= 93:
  43. set {_valid.%loop-player%} to false
  44. loop blocks above block above {_puddleLoc}:
  45. if loop-block is not fallthroughable:
  46. set {_valid.%loop-player%} to false
  47. else:
  48. set {_valid.%loop-player%} to false
  49. else:
  50. set {_valid.%loop-player%} to false
  51. if {_valid.%loop-player%} is true:
  52. if {puddle.debug} is on:
  53. message "Puddle added at %{_puddleLoc}% replacing %block at {_puddleLoc}%" to loop-player
  54. add {_puddleLoc} to {puddleLocations.%loop-player's world%::*}
  55. set block at {_puddleLoc} to air
  56. wait 1 tick
  57. set block at {_puddleLoc} to water
  58. set data value of block at {_puddleLoc} to 7
  59.  
  60. every 1 second:
  61. loop worlds:
  62. set {_chance} to 20%
  63. if is raining in loop-world:
  64. if time in loop-world is between 20:00 and 8:00:
  65. set {_chance} to {_chance} * 0.25
  66. else if time in loop-world is between 11:00 and 16:00:
  67. set {_chance} to {_chance} * 0.75
  68. else:
  69. set {_chance} to {_chance} * 0.50
  70. else if is thundering in loop-world:
  71. if time in loop-world is between 20:00 and 8:00:
  72. set {_chance} to {_chance} * 0.05
  73. if time in loop-world is between 11:00 and 16:00:
  74. set {_chance} to {_chance} * 0.2
  75. else:
  76. set {_chance} to {_chance} * 0.1
  77. else if is sunny in loop-world:
  78. if time in loop-world is between 20:00 and 8:00:
  79. set {_chance} to {_chance} * 0.9
  80. else if time in loop-world is between 11:00 and 16:00:
  81. set {_chance} to {_chance} * 1.2
  82. else:
  83. set {_chance} to {_chance} * 1
  84.  
  85. else:
  86. stop
  87. chance of {_chance}:
  88. set {_loc} to a random location out of {puddleLocations.%loop-world%::*}
  89. if {_loc} is set:
  90. if block at {_loc} is water:
  91. if data value of block at {_loc} is 7:
  92. set block at {_loc} to air
  93. if {puddle.debug} is on:
  94. broadcast "Puddle removed at %{_loc}%"
  95. else if {puddle.debug} is on:
  96. broadcast "Puddle no longer exists at %{_loc}%"
  97. else if {puddle.debug} is on:
  98. broadcast "Puddle no longer exists at %{_loc}%"
  99. wait 1 tick
  100. remove all {_loc} from {puddleLocations.%loop-world%::*}
  101. if {weather.%loop-world%.timer} is set:
  102. if {weather.%loop-world%.timer} > 0:
  103. subtract 1 from {weather.%loop-world%.timer}
  104. else:
  105. execute the console command "/toggledownfall %loop-world%"
  106. clear {weather.%loop-world%.timer}
  107.  
  108.  
  109. command /puddles [<text>] [<text="%command sender's world%">] [<text="%command sender's world%">]:
  110. aliases: /puddle
  111. trigger:
  112. if player is an op:
  113. if argument 1 is "clear":
  114. if argument 2 is "all":
  115. loop worlds:
  116. loop {puddleLocations.%loop-world%::*}:
  117. set block at loop-value to air
  118. remove all loop-value from {puddleLocations.%loop-world%::*}
  119. message "<light red>Cleared all puddles in all worlds..."
  120. else if argument 2 is not "all":
  121. loop {puddleLocations.%argument 2%::*}:
  122. set block at loop-value to air
  123. remove all loop-value from {puddleLocations.%argument 2%::*}
  124. message "<light red>Cleared all puddles in world ""%argument 2%"""
  125. else if argument 1 is "list":
  126. if argument 2 is "all":
  127. loop worlds:
  128. loop {puddleLocations.%loop-world%::*}:
  129. message "(%loop-index%). %loop-value% in world ""%loop-world%"""
  130. message "<light green>Listed all puddles in all worlds"
  131. else:
  132. loop {puddleLocations.%argument 2%::*}:
  133. message "(%loop-index%). %loop-value%" to command sender
  134. message "<light green>Listed all puddles in world ""%argument 2%"""
  135. else if argument 1 is "create":
  136. set {_loc} to location of block at player's location
  137. add {_loc} to {puddleLocations.%argument 2%::*}
  138. set block at {_loc} to water
  139. set data value of block at {_loc} to 7
  140. message "%command sender% Created a puddle at %{_loc}%"
  141. else if argument 1 is "enable", "disable", "on", or "off":
  142. if argument 1 is "enable" or "on":
  143. if argument 2 parsed as world is a world:
  144. if {puddles.blacklist::*} contains argument 2 parsed as world:
  145. remove all argument 2 parsed as world from {puddles.blacklist::*}
  146. message "<light green>Puddles enabled for the world ""%argument 2%"""
  147. else:
  148. message "<light red>Puddles already enabled in world ""%argument 2%"""
  149. else:
  150. message "<light red>%argument 2% is not a world"
  151. else if argument 1 is "disable", or "off":
  152. if argument 2 parsed as world is a world:
  153. if {puddles.blacklist::*} contains argument 2 parsed as world:
  154. message "<light red>Puddles already disabled in world ""%argument 2%"""
  155. else:
  156. add argument 2 parsed as world to {puddles.blacklist::*}
  157. message "<light green>Puddles disabled in world ""%argument 2%"""
  158. else:
  159. message "<light red>%argument 2% is not a world"
  160. else if argument 1 is "tp" or "teleport":
  161. if argument 2 parsed as integer is an integer:
  162. if argument 3 parsed as world is a world:
  163. if {puddleLocations.%argument 3%::%argument 2%} is set:
  164. teleport command sender to {puddleLocations.%argument 3%::%argument 2%}
  165. else:
  166. message "puddle %argument 2% in world %argument 3% does not exist"
  167. else:
  168. message "%argument 3% is not a world"
  169. else:
  170. message "The second argument must be an integer"
  171. else if argument 1 is "worlds" or "world":
  172. loop worlds:
  173. if {puddles.blacklist::*} contains loop-world:
  174. message "<light red>%loop-world%"
  175. else:
  176. message "<light green>%loop-world%"
  177. message "<light green>-----------------------"
  178. message "<light green>Green worlds have puddles enabled"
  179. else if argument 1 is "test":
  180. set {_valid.%player%} to true
  181. set {_loc} to location of player
  182. set {_world} to player's world
  183. set {_puddleLoc} to player's location
  184. if {puddles.blacklist::*} contains player's world:
  185. message "This world does not have puddles enabled"
  186. message "%{puddles.blacklist::*}%"
  187. else:
  188. if block at {_puddleLoc} is replaceable:
  189. if block below {_puddleLoc} is landonable:
  190. if biome at {_puddleLoc} is {@disallowed biome}:
  191. set {_valid.%player%} to false
  192. else if biome at {_puddleLoc} is Extreme Hills, Extreme Hills Mountains, Extreme Hills Plus, or Extreme Hills Plus Mountains:
  193. if {_vertical} >= 93:
  194. set {_valid.%player%} to false
  195. loop blocks above block above {_puddleLoc}:
  196. if loop-block is not fallthroughable:
  197. message "%loop-block% (%loop-block's id%:%loop-block's damage value%) is not fallthroughable"
  198. set {_valid.%player%} to false
  199. add loop-block to {_invalidBlocks::*}
  200. if {_valid.%player%} is false:
  201. loop 4 times:
  202. loop {_invalidBlocks::*}:
  203. make player see block at loop-value's location as red wool
  204. wait 0.5 second
  205. loop {_invalidBlocks::*}:
  206. make player see block at loop-value's location as loop-value
  207. wait 0.5 second
  208. else:
  209. set {_valid.%player%} to false
  210. message "puddle cannot land on %block below {_puddleLoc}%"
  211. wait 1 tick
  212. loop 4 times:
  213. make player see block below {_puddleLoc} as red wool
  214. wait 0.5 second
  215. make player see block below {_puddleLoc} as block below {_puddleLoc}
  216. wait 0.5 second
  217. else:
  218. message "%block at {_puddleLoc}% is not replaceable"
  219. loop 4 times:
  220. make player see block at {_puddleLoc} as red wool
  221. wait 0.5 second
  222. make player see block at {_puddleLoc} as block at {_puddleLoc}
  223. wait 0.5 second
  224. set {_valid.%player%} to false
  225. if {_valid.%player%} is true:
  226. message "puddle is placeable at your feet"
  227. else if argument 1 is "help":
  228. message "<light green>----------"
  229. if argument 2 parsed as world is a world: #This means that argument 2 was not changed
  230. message "<light green> Listing all commands for /puddles"
  231. message "<light green>----------"
  232. message "/puddle clear"
  233. message "/puddle list"
  234. message "/puddle create"
  235. message "/puddle enable"
  236. message "/puddle disable"
  237. message "/puddle tp"
  238. message "/puddle world"
  239. message "/puddle help"
  240. else if argument 2 is "clear":
  241. message "<light green>Description: Clears puddles in a world (or all worlds, or another specific world if specified)"
  242. message ""
  243. message "<light green>Usage: /puddle clear [<all|world>]"
  244. message ""
  245. message "<light green>Info: If the world is not specified, it clears all puddles in your current world"
  246. else if argument 2 is "list":
  247. message "<light green>Description: Lists all puddles in a world (or all worlds, or another specific world if specified)"
  248. message ""
  249. message "<light green>Usage: /puddles list [<all|world>]"
  250. message ""
  251. message "<light green>Info: If the world is not specified, it lists all puddles in your current world"
  252. message "<light green>This command is only useful for debugging purposes"
  253. else if argument 2 is "create":
  254. message "<light green>Description: Creates a puddle at your feet, ignoring all conditions that would normally stop a puddle from forming"
  255. message ""
  256. message "<light green>Usage: /puddle create"
  257. else if argument 2 is "enable" or "on":
  258. message "<light green>Description: Enables puddles from a world that has puddles disabled via the disable command"
  259. message ""
  260. message "<light green>Usage: /puddles enable [<all|world>]"
  261. message ""
  262. message "<light green>Info: If the world is not specified, it enables puddles to form in your current world"
  263. else if argument 2 is "disable" or "off":
  264. message "<light green>Descripion: Disables puddles in a world"
  265. message ""
  266. message "<light green>Usage: /puddles disable [<all|world>]"
  267. message ""
  268. message "<light green>Info: If the world is not specified, it disables puddles from forming in your current world"
  269. else if argument 2 is "tp" or "teleport":
  270. message "<light green>Description: Teleports you to the specified puddle"
  271. message ""
  272. message "<light green>Usage: /puddle tp <integer> [<world>]"
  273. message ""
  274. message "<light green>Info: You can get the puddle number by using ""/puddle list"""
  275. message "<light green>If you do not specify a world, it uses your current world"
  276. else if argument 2 is "world" or "worlds":
  277. message "<light green>Description: Lists all worlds and whether or not puddles are enabled"
  278. message ""
  279. message "<light green>Usage /puddles world"
  280. else if argument 2 is "help":
  281. message "<light green>Description: Lists all commands for puddles and how to use them"
  282. message ""
  283. message "<light green>Usage: /puddles help <command>"
  284. else if argument 2 is "test":
  285. message "<light green>Description: Tests to see if a puddle can be placed at your feet, and if it cannot, it tells you why."
  286. message ""
  287. message "<light green>Usage: /puddles test"
  288. else:
  289. message "<light red>That command does not exist"
  290. else:
  291. message "<light red>/puddles <help> [<command>]"
  292. else:
  293. message "<red>You do not have permission to do this"
  294.  
  295. on physics:
  296. if event-block is water:
  297. if data value of event-block is 7:
  298. set {_persist} to false
  299. set {_loc} to event-block's location
  300. loop {puddleLocations.%event-world%::*}:
  301. if "%loop-value%" = "%{_loc}%":
  302. if block below event-block is landonable:
  303. cancel the event
  304. set {_persist} to true
  305. if {_persist} is true:
  306. if {puddle.debug} is true:
  307. broadcast "Puddle persisting at %{_loc}%"
  308.  
  309. command /pdebug <boolean>:
  310. trigger:
  311. if command sender is an op:
  312. set {puddle.debug} to argument 1
  313. else:
  314. message "<red>You do not have permission to do this"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement