Gamebuster icon

Puddles.sk v1.6.0.2/(2.2)

Gamebuster | PRO | 06/22/15 01:28:04 PM UTC | 0 ⭐ | 1358 👁️ | Never ⏰ | []
text |

14.62 KB

|

None

|

0 👍

/

0 👎

#Version 1.6.0.3/(2.2)
#In order to download or use this software, you must agree to it's license: http://pastebin.com/raw.php?i=JGSLhFdU
#Edit options and aliases to customize the skript
 options:
	rangeXZ : 100				#The distance on both horizontal axes in which puddles can form
	rangeY : 20					#The distance on the Y axis in which puddles can form
	#COMMENT FOR BELOW OPTION   #The list of biomes that puddles cannot form in, make sure you have OR and not AND at the end
	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
 aliases:
	#USE NUMERICAL BLOCK IDS FOR THIS LIST
	#
	#
	#
	#LANDONABLE-Blocks that puddles can land on
	#FALLTHROUGHABLE-Blocks that puddles can form under
	#REPLACEABLE-Blocks that puddles can replace 
	landonable = 1, 2, 3, 4, 7, 12, 5, 17, 162, 13, 97, 98, 16, 15, 73, 14, 129, 56, 21
	fallthroughable = 0, 18, 161, 8, 9, 175
	replaceable = 0, 31, 32, 37, 38, 78:0, 175, #55 #(redstone not replaceable by default)
 every 1 tick:
	loop players:
		if is raining or thundering in loop-player's world:
			if {puddles.blacklist::*} contains loop-player's world:
				stop
			else:
				set {_valid.%loop-player%} to true
				set {_loc} to location of block at loop-player
				add a random integer between -{@rangeXZ} and {@rangeXZ} to {_loc}'s x-coordinate
				add a random integer between -{@rangeXZ} and {@rangeXZ} to {_loc}'s z-coordinate
				add a random integer between -{@rangeY} and {@rangeY} to {_loc}'s y-coordinate
				#broadcast "%{_loc}%"
				set {_world} to loop-player's world
				set {_puddleLoc} to location of block at {_loc}
				if block at {_puddleLoc} is replaceable:
					if block below {_puddleLoc} is landonable:
						if biome at {_puddleLoc} is {@disallowed biome}:
							set {_valid.%loop-player%} to false
						else if biome at {_puddleLoc} is Extreme Hills, Extreme Hills Mountains, Extreme Hills Plus, or Extreme Hills Plus Mountains:
							if {_vertical} >= 93:
								set {_valid.%loop-player%} to false
						loop blocks above block above {_puddleLoc}:
							if loop-block is not fallthroughable:
								set {_valid.%loop-player%} to false
					else:
						set {_valid.%loop-player%} to false
				else:
					set {_valid.%loop-player%} to false
				if {_valid.%loop-player%} is true:
					if {puddle.debug} is on:
						message "Puddle added at %{_puddleLoc}% replacing %block at {_puddleLoc}%" to loop-player
					add {_puddleLoc} to {puddleLocations.%loop-player's world%::*}
					set block at {_puddleLoc} to air
					wait 1 tick
					set block at {_puddleLoc} to water
					set data value of block at {_puddleLoc} to 7
 every 1 second:
	loop worlds:
		set {_chance} to 20%
		if is raining in loop-world:
			if time in loop-world is between 20:00 and 8:00:
				set {_chance} to {_chance} * 0.25
			else if time in loop-world is between 11:00 and 16:00:
				set {_chance} to {_chance} * 0.75
			else:
				set {_chance} to {_chance} * 0.50
		else if is thundering in loop-world:
			if time in loop-world is between 20:00 and 8:00:
				set {_chance} to {_chance} * 0.05
			if time in loop-world is between 11:00 and 16:00:
				set {_chance} to {_chance} * 0.2
			else:
				set {_chance} to {_chance} * 0.1
		else if is sunny in loop-world:
			if time in loop-world is between 20:00 and 8:00:
				set {_chance} to {_chance} * 0.9
			else if time in loop-world is between 11:00 and 16:00:
				set {_chance} to {_chance} * 1.2
			else:
				set {_chance} to {_chance} * 1
 		else:
			stop
		chance of {_chance}:
			set {_loc} to a random location out of {puddleLocations.%loop-world%::*}
			if {_loc} is set:
				if block at {_loc} is water block:
					if data value of block at {_loc} is 7:
						set block at {_loc} to air
						if {puddle.debug} is on:
							broadcast "Puddle removed at %{_loc}%"
					else if {puddle.debug} is on:
						broadcast "Puddle no longer exists at %{_loc}%"
				else if {puddle.debug} is on:
					broadcast "Puddle no longer exists at %{_loc}%"
				wait 1 tick
				remove all {_loc} from {puddleLocations.%loop-world%::*}
		if {weather.%loop-world%.timer} is set:
			if {weather.%loop-world%.timer} > 0:
				subtract 1 from {weather.%loop-world%.timer}
			else:
				execute the console command "/toggledownfall %loop-world%"
				clear {weather.%loop-world%.timer}
  command /puddles [<text>] [<text="%command sender's world%">] [<text="%command sender's world%">]:
	aliases: /puddle
	trigger:
		if player is an op:
			if argument 1 is "clear":
				if argument 2 is "all":
					loop worlds:
						loop {puddleLocations.%loop-world%::*}:
							set block at loop-value-2 to air
							remove all loop-value-2 from {puddleLocations.%loop-world%::*}
					message "<light red>Cleared all puddles in all worlds..."
				else if argument 2 is not "all":
					loop {puddleLocations.%argument 2%::*}:
						set block at loop-value to air
						remove all loop-value from {puddleLocations.%argument 2%::*}
					message "<light red>Cleared all puddles in world ""%argument 2%"""
			else if argument 1 is "list":
				if argument 2 is "all":
					set {_amount} to 0
					loop worlds:
						loop {puddleLocations.%loop-world%::*}:
							message "(%loop-index%). %loop-value-2% in world ""%loop-world%"""
							add 1 to {_amount}
					message "<light green>Listed all puddles in all worlds. (%{_amount}% total)"
				else:
					set {_amount} to 0
					loop {puddleLocations.%argument 2%::*}:
						message "(%loop-index%). %loop-value%" to command sender
						add 1 to {_amount}
					message "<light green>Listed all puddles in world ""%argument 2%"". (%{_amount}% total)"
			else if argument 1 is "create":
				set {_loc} to location of block at player's location
				add {_loc} to {puddleLocations.%argument 2%::*}
				set block at {_loc} to water
				set data value of block at {_loc} to 7
				message "%command sender% Created a puddle at %{_loc}%"
			else if argument 1 is "enable" or "disable" or "on" or "off":
				if argument 1 is "enable" or "on":
					if argument 2 parsed as world is a world:
						if {puddles.blacklist::*} contains argument 2 parsed as world:
							remove all argument 2 parsed as world from {puddles.blacklist::*}
							message "<light green>Puddles enabled for the world ""%argument 2%"""
						else:
							message "<light red>Puddles already enabled in world ""%argument 2%"""
					else:
						message "<light red>%argument 2% is not a world"
				else if argument 1 is "disable", or "off":
					if argument 2 parsed as world is a world:
						if {puddles.blacklist::*} contains argument 2 parsed as world:
							message "<light red>Puddles already disabled in world ""%argument 2%"""
						else:
							add argument 2 parsed as world to {puddles.blacklist::*}
							message "<light green>Puddles disabled in world ""%argument 2%"""
					else:
						message "<light red>%argument 2% is not a world"
			else if argument 1 is "tp" or "teleport":
				if argument 2 parsed as integer is an integer:
					if argument 3 parsed as world is a world:
						if {puddleLocations.%argument 3%::%argument 2%} is set:
							teleport command sender to {puddleLocations.%argument 3%::%argument 2%}
						else:
							message "puddle %argument 2% in world %argument 3% does not exist"
					else:
						message "%argument 3% is not a world"
				else:
					message "The second argument must be an integer"
			else if argument 1 is "worlds" or "world":
				loop worlds:
					if {puddles.blacklist::*} contains loop-world:
						message "<light red>%loop-world%"
					else:
						message "<light green>%loop-world%"
				message "<light green>-----------------------"
				message "<light green>Green worlds have puddles enabled"
			else if argument 1 is "test":
				set {_valid.%player%} to true
				set {_loc} to location of player
				set {_world} to player's world
				set {_puddleLoc} to player's location
				if {puddles.blacklist::*} contains player's world:
					message "This world does not have puddles enabled"
					message "%{puddles.blacklist::*}%"
				else:
					if block at {_puddleLoc} is replaceable:
						if block below {_puddleLoc} is landonable:
							if biome at {_puddleLoc} is {@disallowed biome}:
								set {_valid.%player%} to false
							else if biome at {_puddleLoc} is Extreme Hills, Extreme Hills Mountains, Extreme Hills Plus, or Extreme Hills Plus Mountains:
								if {_vertical} >= 93:
									set {_valid.%player%} to false
							loop blocks above block above {_puddleLoc}:
								if loop-block is not fallthroughable:
									message "%loop-block% (%loop-block's id%:%loop-block's damage value%) is not fallthroughable"
									set {_valid.%player%} to false
									add loop-block to {_invalidBlocks::*}
							if {_valid.%player%} is false:
								loop 4 times:
									loop {_invalidBlocks::*}:
										make player see block at loop-value-2's location as red wool
									wait 0.5 second
									loop {_invalidBlocks::*}:
										make player see block at loop-value-2's location as block at loop-value-2
									wait 0.5 second
						else:
							set {_valid.%player%} to false
							message "puddle cannot land on %block below {_puddleLoc}%"
							wait 1 tick
							loop 4 times:
								make player see block below {_puddleLoc} as red wool
								wait 0.5 second
								make player see block below {_puddleLoc} as block below {_puddleLoc}
								wait 0.5 second
					else:
						message "%block at {_puddleLoc}% is not replaceable"
						loop 4 times:
							make player see block at {_puddleLoc} as red wool
							wait 0.5 second
							make player see block at {_puddleLoc} as block at {_puddleLoc}
							wait 0.5 second
						set {_valid.%player%} to false
					if {_valid.%player%} is true:
						message "puddle is placeable at your feet"
			else if argument 1 is "debug":
				if argument 2 parsed as boolean is a boolean:
					set {puddle.debug} to argument 2 parsed as boolean
					if {puddle.debug} is true:
						message "<light green>Debug mode on"
					else:
						message "<light green>Debug mode off"
				else:
					message "<yellow>Usage: /Puddle debug <on/off>"
			else if argument 1 is "help":
				message "<light green>----------"
				if argument 2 parsed as world is a world: #This means that argument 2 was not changed
					message "<light green> Listing all commands for /puddles"
					message "<light green>----------"
					message "/puddle clear"
					message "/puddle list"
					message "/puddle create"
					message "/puddle enable"
					message "/puddle disable"
					message "/puddle tp"
					message "/puddle world"
					message "/puddle debug"
					message "/puddle help"
					message "<light green>----------"
					message ""
					message "<light green>----------"
				else if argument 2 is "clear":
					message "<light green>Description: Clears puddles in a world (or all worlds, or another specific world if specified)"
					message ""
					message "<light green>Usage: /puddle clear [<all|world>]"
					message ""
					message "<light green>Info: If the world is not specified, it clears all puddles in your current world"
				else if argument 2 is "list":
					message "<light green>Description: Lists all puddles in a world (or all worlds, or another specific world if specified)"
					message ""
					message "<light green>Usage: /puddles list [<all|world>]"
					message ""
					message "<light green>Info: If the world is not specified, it lists all puddles in your current world"
					message "<light green>This command is only useful for debugging purposes"
				else if argument 2 is "create":
					message "<light green>Description: Creates a puddle at your feet, ignoring all conditions that would normally stop a puddle from forming"
					message ""
					message "<light green>Usage: /puddle create"
				else if argument 2 is "enable" or "on":
					message "<light green>Description: Enables puddles from a world that has puddles disabled via the disable command"
					message ""
					message "<light green>Usage: /puddles enable [<all|world>]"
					message ""
					message "<light green>Info: If the world is not specified, it enables puddles to form in your current world"
				else if argument 2 is "disable" or "off":
					message "<light green>Descripion: Disables puddles in a world"
					message ""
					message "<light green>Usage: /puddles disable [<all|world>]"
					message ""
					message "<light green>Info: If the world is not specified, it disables puddles from forming in your current world"
				else if argument 2 is "tp" or "teleport":
					message "<light green>Description: Teleports you to the specified puddle"
					message ""
					message "<light green>Usage: /puddle tp <integer> [<world>]"
					message ""
					message "<light green>Info: You can get the puddle number by using ""/puddle list"""
					message "<light green>If you do not specify a world, it uses your current world"
				else if argument 2 is "world" or "worlds":
					message "<light green>Description: Lists all worlds and whether or not puddles are enabled"
					message ""
					message "<light green>Usage /puddles world"
				else if argument 2 is "help":
					message "<light green>Description: Lists all commands for puddles and how to use them"
					message ""
					message "<light green>Usage: /puddles help <command>"
				else if argument 2 is "test":
					message "<light green>Description: Tests to see if a puddle can be placed at your feet, and if it cannot, it tells you why."
					message ""
					message "<light green>Usage: /puddles test"
				else if argument 2 is "debug":
					message "<light green>Description: Enables the debug mode to track what is occurring, You generally will not need to use this."
					message ""
					message "<light green>Usage: /puddle debug <on/off>"
				else:
					message "<light red>That command does not exist"
			else:
				message "<light red>/puddles <help> [<command>]"
		else:
			message "<red>You do not have permission to do this"
 on physics:
	if event-block is water block:
		if data value of event-block is 7:
			set {_persist} to false
			set {_loc} to event-block's location
			loop {puddleLocations.%event-world%::*}:
				if "%loop-value%" = "%{_loc}%":
					if block below event-block is landonable:
						cancel the event
						set {_persist} to true
			if {_persist} is true:
				if {puddle.debug} is true:
					broadcast "Puddle persisting at %{_loc}%"

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎