forked from PalaceInteractiveArchive/Show
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showgen commands functional with worldedit 7
- Loading branch information
Showing
10 changed files
with
390 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/main/java/network/palace/show/commands/ShowgenCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package network.palace.show.commands; | ||
|
||
import network.palace.show.commands.showgen.GenerateCommand; | ||
import network.palace.show.commands.showgen.SetCornerCommand; | ||
import network.palace.show.commands.showgen.SetInitialCommand; | ||
import org.bukkit.ChatColor; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.Arrays; | ||
|
||
public class ShowgenCommand implements CommandExecutor { | ||
|
||
@Override | ||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) { | ||
if (args.length == 0) { | ||
sender.sendMessage(ChatColor.GREEN + "ShowGen Commands:"); | ||
sender.sendMessage(ChatColor.AQUA + "/showgen generate [action] [bottom/top] [delay per layer] [timestamp]" + ChatColor.GREEN + "- Generate blocks of show actions with one command"); | ||
sender.sendMessage(ChatColor.AQUA + "/showgen setcorner x,y,z" + ChatColor.GREEN + "- Set the location of the final north-west-bottom corner to help give real coordinate values"); | ||
sender.sendMessage(ChatColor.AQUA + "/showgen setinitialscene " + ChatColor.GREEN + "- Set the initial scene for a generator session"); | ||
return true; | ||
} | ||
|
||
if (!(sender instanceof Player)) { | ||
sender.sendMessage(ChatColor.RED + "You must be a player to run this command!"); | ||
} | ||
|
||
switch (args[0]) { | ||
case "generate": | ||
String[] newArgs = Arrays.copyOfRange(args, 1, args.length); | ||
new GenerateCommand().handle(sender, newArgs); | ||
break; | ||
case "setcorner": | ||
new SetCornerCommand().handle(sender, args); | ||
break; | ||
case "setinitialscene": | ||
new SetInitialCommand().handle(sender); | ||
break; | ||
default: | ||
sender.sendMessage(ChatColor.GREEN + "ShowGen Commands:"); | ||
sender.sendMessage(ChatColor.AQUA + "/showgen generate [action] [bottom/top] [delay per layer] [timestamp]" + ChatColor.GREEN + "- Generate blocks of show actions with one command"); | ||
sender.sendMessage(ChatColor.AQUA + "/showgen setcorner x,y,z" + ChatColor.GREEN + "- Set the location of the final north-west-bottom corner to help give real coordinate values"); | ||
sender.sendMessage(ChatColor.AQUA + "/showgen setinitialscene " + ChatColor.GREEN + "- Set the initial scene for a generator session"); | ||
break; | ||
} | ||
return true; | ||
} | ||
} |
Oops, something went wrong.