-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
32 additions
and
136 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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
39 changes: 15 additions & 24 deletions
39
src/main/java/aldrigos/mc/worldguard/commands/WgCommand.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 |
---|---|---|
@@ -1,55 +1,46 @@ | ||
package aldrigos.mc.worldguard.commands; | ||
|
||
import aldrigos.mc.worldguard.Cuboid; | ||
import aldrigos.mc.worldguard.*; | ||
import cn.nukkit.command.*; | ||
import cn.nukkit.utils.Logger; | ||
|
||
import java.util.Arrays; | ||
import java.util.LinkedList; | ||
import java.util.Map; | ||
|
||
public class WgCommand extends Command { | ||
private static final String help = "[WG]Commands list:\n" + | ||
"/wg info : about this plugin\n"+ | ||
"/rg create <region> : create a new region\n" + | ||
"/rg delete <region> : delete a region\n"+ | ||
"/rg flag : list all available flags\n"+ | ||
"/rg flag <region> <flag> <allow|deny> : add a flag to region\n"+ | ||
"/rg flags <region> : show set flags for the region\n"+ | ||
"/rg update <region> : change region cuboid with current selection"; | ||
|
||
public final RegionManager rgm; | ||
public final Map<Long, Cuboid> selection; | ||
public final Logger log; | ||
|
||
public WgCommand(WorldGuardPlugin p){ | ||
super("wg"); | ||
rgm = p.RegionManager; | ||
selection = p.Selection; | ||
log = p.getLogger(); | ||
} | ||
|
||
@Override | ||
public boolean execute(CommandSender sender, String cmd, String[] args) { | ||
if(args.length < 1){ | ||
sender.sendMessage("[WG]Commands list:\n" + | ||
"/wg info : about this plugin\n"+ | ||
"/rg create <region> : create a new region\n" + | ||
"/rg delete <region> : delete a region\n"+ | ||
"/rg flag : list all available flags\n"+ | ||
"/rg flag <region> <flag> <allow|deny> : add a flag to region\n"+ | ||
"/rg flags <region> : show set flags for the region\n"+ | ||
"/rg update <region> : change region cuboid with current selection" | ||
); | ||
sender.sendMessage(help); | ||
return true; | ||
} | ||
|
||
final String sub = args[0]; | ||
|
||
switch (sub){ | ||
switch (args[0]){ | ||
case "info": | ||
sender.sendMessage("[WG]WorldGuard port for Nukkit by Aldrigo Raffaele"); | ||
return true; | ||
case "?": | ||
case "help": | ||
sender.sendMessage(help); | ||
return true; | ||
default: | ||
sender.sendMessage("[WG]Unknown wg sub-command: "+ cmd); | ||
return false; | ||
} | ||
|
||
/*var subArgs = new LinkedList<String>(Arrays.asList(args)); | ||
subArgs.removeFirst(); | ||
return executor.execute(sender, cmd, subArgs);*/ | ||
} | ||
} |
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