Add arg 2 validation in reset options

This commit is contained in:
Govindas 2021-06-21 10:10:26 +00:00
parent f4561a7535
commit 6346ff56bc

View File

@ -563,6 +563,9 @@ command /fastworldreset [<text>] [<text>] [<text>]:
set {fastworldreset::exitpoint} to location of player set {fastworldreset::exitpoint} to location of player
send "&a&lFastWorldReset&2&l> &aYou have successfully set exit point at &e&l%{fastworldreset::exitpoint}%" send "&a&lFastWorldReset&2&l> &aYou have successfully set exit point at &e&l%{fastworldreset::exitpoint}%"
else if arg 1 is "disable-chunk-reset": else if arg 1 is "disable-chunk-reset":
if arg 2 is not set:
send "&a&lFastWorldReset&2&l> &cUsage: &e/fwr disable-chunk-reset <world>"
stop
if (arg 2 parsed as a world) is not a world: if (arg 2 parsed as a world) is not a world:
send "&a&lFastWorldReset&2&l> &cThe specified world &e%arg 2% &cis not loaded." send "&a&lFastWorldReset&2&l> &cThe specified world &e%arg 2% &cis not loaded."
stop stop
@ -573,6 +576,9 @@ command /fastworldreset [<text>] [<text>] [<text>]:
else: else:
send "&a&lFastWorldReset&2&l> &cChunk-based reset is already disabled in world &e%arg 2%&c!" send "&a&lFastWorldReset&2&l> &cChunk-based reset is already disabled in world &e%arg 2%&c!"
else if arg 1 is "enable-chunk-reset": else if arg 1 is "enable-chunk-reset":
if arg 2 is not set:
send "&a&lFastWorldReset&2&l> &cUsage: &e/fwr disable-chunk-reset <world>"
stop
if (arg 2 parsed as a world) is not a world: if (arg 2 parsed as a world) is not a world:
send "&a&lFastWorldReset&2&l> &cThe specified world &e%arg 2% &cis not loaded." send "&a&lFastWorldReset&2&l> &cThe specified world &e%arg 2% &cis not loaded."
stop stop