Check if player has island when inviting players
This commit is contained in:
parent
f4bf8e8964
commit
3cdf57192c
|
|
@ -17,6 +17,10 @@ public class IslandInvite extends PlayerSubCommand {
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(Player player, IslandPlayer islandPlayer, String[] args) {
|
public boolean execute(Player player, IslandPlayer islandPlayer, String[] args) {
|
||||||
MessageConfiguration.Commands.Island.Invite invite = plugin.messagesConfiguration().get().commands().island().invite();
|
MessageConfiguration.Commands.Island.Invite invite = plugin.messagesConfiguration().get().commands().island().invite();
|
||||||
|
if (islandPlayer.islandId() == 0) {
|
||||||
|
player.sendRichMessage(invite.noIsland());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (args.length < 1) {
|
if (args.length < 1) {
|
||||||
player.sendRichMessage(plugin.messagesConfiguration().get().commands().island().commandUsage());
|
player.sendRichMessage(plugin.messagesConfiguration().get().commands().island().commandUsage());
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,7 @@ public class MessageConfiguration implements Configuration {
|
||||||
@ConfigSerializable @Getter
|
@ConfigSerializable @Getter
|
||||||
public static class Invite {
|
public static class Invite {
|
||||||
String inviteSelf = "<red>You can not invite yourself to this island.";
|
String inviteSelf = "<red>You can not invite yourself to this island.";
|
||||||
|
String noIsland = "<red>You need an island to run this command.";
|
||||||
String targetOffline = "<red><target> not found, is the player online?";
|
String targetOffline = "<red><target> not found, is the player online?";
|
||||||
String targetHasIsland = "<red><target> already has an island and can not be invited.";
|
String targetHasIsland = "<red><target> already has an island and can not be invited.";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user