Add some more output to commands
This commit is contained in:
parent
b04fc5d8a1
commit
dc6293eb45
|
|
@ -17,6 +17,7 @@ public class ChallengeCommand extends PlayerSubCommand {
|
|||
@Override
|
||||
public boolean execute(Player player, IslandPlayer islandPlayer, String[] args) {
|
||||
// open challenge inventory - not implemented yet -- TODO
|
||||
player.sendRichMessage("<red>Not implemented yet, please wait for a future update.");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ public class IslandCommand extends PlayerSubCommand {
|
|||
registerSubCommand(new IslandAccept(plugin));
|
||||
registerSubCommand(new IslandDeny(plugin));
|
||||
registerSubCommand(new IslandLeave(plugin));
|
||||
registerSubCommand(new IslandLevel(plugin)); // TODO -- Add IslandLevelCommand
|
||||
// registerSubCommand(new IslandTop(plugin)); // TODO -- Add IslandTopCommand
|
||||
registerSubCommand(new IslandInvite(plugin));
|
||||
registerSubCommand(new IslandKick(plugin)); // TODO -- Add IslandKickCommand
|
||||
|
|
@ -31,13 +30,13 @@ public class IslandCommand extends PlayerSubCommand {
|
|||
@Override
|
||||
public boolean execute(Player player, IslandPlayer islandPlayer, String[] args) {
|
||||
if (islandPlayer.islandId() == 0) {
|
||||
// You need an island to be able to do this
|
||||
player.sendRichMessage("<red>You should create an island before doing this. Do /island go");
|
||||
return true;
|
||||
}
|
||||
|
||||
Island island = Island.getIsland(islandPlayer.islandUUID());
|
||||
if (island == null) {
|
||||
// "Could not load your island. Contact an administrator"
|
||||
player.sendRichMessage("<red>Could not load your island. Contact an administrator");
|
||||
return true;
|
||||
}
|
||||
new IslandGUI(island).open(player);
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ public class IslandKick extends PlayerSubCommand {
|
|||
|
||||
@Override
|
||||
public boolean execute(Player player, IslandPlayer islandPlayer, String[] args) {
|
||||
// TODO -- implement island kick
|
||||
player.sendRichMessage("<red>Not implemented yet, please wait for a future update.");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +0,0 @@
|
|||
package com.alttd.cometskyblock.commands.island;
|
||||
|
||||
import com.alttd.cometskyblock.CometSkyBlockPlugin;
|
||||
import com.alttd.cometskyblock.commands.PlayerSubCommand;
|
||||
import com.alttd.cometskyblock.island.IslandPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class IslandLevel extends PlayerSubCommand {
|
||||
|
||||
public IslandLevel(CometSkyBlockPlugin plugin) {
|
||||
super(plugin, "level");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(Player player, IslandPlayer islandPlayer, String[] args) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -30,7 +30,7 @@ public class IslandRestart extends PlayerSubCommand {
|
|||
}
|
||||
Island island = Island.getIsland(islandPlayer.islandUUID());
|
||||
if (island == null) {
|
||||
// could not load island
|
||||
player.sendRichMessage("<red>Could not load your island. Contact an administrator");
|
||||
return true;
|
||||
}
|
||||
island.request(new RestartRequest(plugin, player, player));
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@ public class IslandRestartConfirm extends PlayerSubCommand {
|
|||
}
|
||||
Island island = Island.getIsland(islandPlayer.islandUUID());
|
||||
if (island == null) {
|
||||
// could not load island
|
||||
player.sendRichMessage("<red>Could not load your island. Contact an administrator");
|
||||
return true;
|
||||
}
|
||||
// check if they have an island request, if not run create request code and ask to rerun command
|
||||
|
||||
Request request = island.request();
|
||||
if (request == null) {
|
||||
player.sendRichMessage(plugin.messagesConfiguration().get().requests().noPendingRequests());
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@ public class IslandRestartDeny extends PlayerSubCommand {
|
|||
}
|
||||
Island island = Island.getIsland(islandPlayer.islandUUID());
|
||||
if (island == null) {
|
||||
// could not load island
|
||||
player.sendRichMessage("<red>Could not load your island. Contact an administrator");
|
||||
return true;
|
||||
}
|
||||
// check if they have an island request, if not run create request code and ask to rerun command
|
||||
|
||||
Request request = island.request();
|
||||
if (request == null) {
|
||||
player.sendRichMessage(plugin.messagesConfiguration().get().requests().noPendingRequests());
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ public class IslandTop extends PlayerSubCommand {
|
|||
// TODO - Finish TOP command
|
||||
@Override
|
||||
public boolean execute(Player player, IslandPlayer islandPlayer, String[] args) {
|
||||
// TODO -- Implement
|
||||
player.sendRichMessage("<red>Not implemented yet, please wait for a future update.");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ public class IslandVisit extends PlayerSubCommand {
|
|||
super(plugin, "visit");
|
||||
}
|
||||
|
||||
// TODO -- ad
|
||||
@Override
|
||||
public boolean execute(Player player, IslandPlayer islandPlayer, String[] args) {
|
||||
MessageConfiguration.Commands.Island.Visit visit = plugin.messagesConfiguration().get().commands().island().visit();
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@ public class IslandManager {
|
|||
|
||||
private final CometSkyBlockPlugin plugin;
|
||||
|
||||
// TODO - move all storage data to another system - SQL / flatfile
|
||||
// This loader is not made for constant saves and loads
|
||||
ConfigurationContainer<IslandConfiguration> islandData;
|
||||
|
||||
public IslandManager(CometSkyBlockPlugin plugin) {
|
||||
|
|
|
|||
|
|
@ -18,24 +18,27 @@ public class RestartRequest extends Request {
|
|||
|
||||
@Override
|
||||
public void accept() {
|
||||
IslandPlayer islandPlayer = IslandPlayer.getIslandPlayer(requester().getUniqueId());
|
||||
// Teleport everyone on the island to spawnworld
|
||||
Island island = Island.getIsland(islandPlayer.islandUUID());
|
||||
if (island == null) {
|
||||
// could not load island
|
||||
return;
|
||||
}
|
||||
World islandWorld = plugin.worldGenerator().loadIslandWorld(island.worldName());
|
||||
if (islandWorld == null) {
|
||||
// could not load world
|
||||
return;
|
||||
}
|
||||
World world = Bukkit.getWorlds().get(0);
|
||||
Location spawnLocation = world.getSpawnLocation();
|
||||
for (Player target : islandWorld.getPlayers()) {
|
||||
target.teleport(spawnLocation);
|
||||
target.sendRichMessage(requests().restart().teleported(), placeholders());
|
||||
}
|
||||
requester().sendRichMessage("<red>This feature is not activated. Please wait for a future update.");
|
||||
|
||||
// TODO - finish restart
|
||||
// IslandPlayer islandPlayer = IslandPlayer.getIslandPlayer(requester().getUniqueId());
|
||||
// // Teleport everyone on the island to spawnworld
|
||||
// Island island = Island.getIsland(islandPlayer.islandUUID());
|
||||
// if (island == null) {
|
||||
// // could not load island
|
||||
// return;
|
||||
// }
|
||||
// World islandWorld = plugin.worldGenerator().loadIslandWorld(island.worldName());
|
||||
// if (islandWorld == null) {
|
||||
// // could not load world
|
||||
// return;
|
||||
// }
|
||||
// World world = Bukkit.getWorlds().get(0);
|
||||
// Location spawnLocation = world.getSpawnLocation();
|
||||
// for (Player target : islandWorld.getPlayers()) {
|
||||
// target.teleport(spawnLocation);
|
||||
// target.sendRichMessage(requests().restart().teleported(), placeholders());
|
||||
// }
|
||||
// TODO - run code to generate a new world and update the id for all members!
|
||||
super.accept();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user