-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Major refactoring of the island-command
- Loading branch information
Showing
50 changed files
with
1,342 additions
and
899 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
5 changes: 3 additions & 2 deletions
5
.../ultimateskyblock/admin/AdminCommand.java → ...ltimateskyblock/command/AdminCommand.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
58 changes: 58 additions & 0 deletions
58
src/main/java/us/talabrek/ultimateskyblock/command/IslandCommand.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,58 @@ | ||
package us.talabrek.ultimateskyblock.command; | ||
|
||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
import us.talabrek.ultimateskyblock.SkyBlockMenu; | ||
import us.talabrek.ultimateskyblock.command.common.AbstractCommandExecutor; | ||
import us.talabrek.ultimateskyblock.command.completion.AllPlayerTabCompleter; | ||
import us.talabrek.ultimateskyblock.command.completion.BiomeTabCompleter; | ||
import us.talabrek.ultimateskyblock.command.completion.OnlinePlayerTabCompleter; | ||
import us.talabrek.ultimateskyblock.command.island.*; | ||
import us.talabrek.ultimateskyblock.uSkyBlock; | ||
|
||
/** | ||
* The main /island command | ||
*/ | ||
public class IslandCommand extends AbstractCommandExecutor { | ||
private final SkyBlockMenu menu; | ||
|
||
public IslandCommand(uSkyBlock plugin, SkyBlockMenu menu) { | ||
super("island|is", null, "general island command"); | ||
this.menu = menu; | ||
InviteHandler inviteHandler = new InviteHandler(plugin); | ||
AllPlayerTabCompleter playerTabCompleter = new AllPlayerTabCompleter(); | ||
addTab("island", playerTabCompleter); | ||
addTab("player", playerTabCompleter); | ||
addTab("oplayer", new OnlinePlayerTabCompleter()); | ||
addTab("biome", new BiomeTabCompleter()); | ||
add(new RestartCommand(plugin)); | ||
add(new LogCommand(plugin, menu)); | ||
add(new CreateCommand(plugin)); | ||
add(new SetHomeCommand(plugin)); | ||
add(new HomeCommand(plugin)); | ||
add(new SetWarpCommand(plugin)); | ||
add(new WarpCommand(plugin)); | ||
add(new ToggleWarp(plugin)); | ||
add(new BanCommand(plugin)); | ||
add(new LockUnlockCommand(plugin)); | ||
add(new TopCommand(plugin)); | ||
add(new BiomeCommand(plugin, menu)); | ||
add(new LevelCommand(plugin)); | ||
add(new InviteCommand(plugin, inviteHandler)); | ||
add(new AcceptRejectCommand(inviteHandler)); | ||
add(new LeaveCommand(plugin)); | ||
add(new KickCommand(plugin)); | ||
add(new PartyCommand(plugin, menu, inviteHandler)); | ||
} | ||
|
||
@Override | ||
public boolean onCommand(CommandSender sender, Command command, String alias, String[] args) { | ||
if (args.length == 0 && sender instanceof Player) { | ||
Player player = (Player) sender; | ||
player.openInventory(menu.displayIslandGUI(player)); | ||
return true; | ||
} | ||
return super.onCommand(sender, command, alias, args); | ||
} | ||
} |
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
Oops, something went wrong.