Fixed missing locale text for invites.

Fixed config settings for teams.
This commit is contained in:
Tastybento 2018-02-04 21:48:34 -08:00
parent fa1ccd0c99
commit 26956d8386
3 changed files with 43 additions and 17 deletions

View File

@ -81,10 +81,18 @@ commands:
description: "display detailed info about your team" description: "display detailed info about your team"
invite: invite:
description: "invite a player to join your island" description: "invite a player to join your island"
invitation-sent: "Invitation sent to [name]"
removing-invite: "Removing invite"
name-has-invited-you: "[name] has invited you to join their island."
to-accept-or-reject: "Do /island team accept to accept, or /island team reject to reject"
you-will-lose-your-island: "&cWARNING! You will lose your island if you accept!"
errors: errors:
cannot-invite-self: "&cYou cannot invite yourself!"
cooldown: "&cYou cannot invite that person for another [time] seconds"
island-is-full: "&cYour island is full, you can't invite anyone else." island-is-full: "&cYour island is full, you can't invite anyone else."
none-invited-you: "&cNo one invited you :c." none-invited-you: "&cNo one invited you :c."
you-already-are-in-team: "&cYou are already on a team!" you-already-are-in-team: "&cYou are already on a team!"
already-on-team: "&cThat player is already on a team!"
invalid-invite: "&cThat invite is no longer valid, sorry." invalid-invite: "&cThat invite is no longer valid, sorry."
parameters: "<player>" parameters: "<player>"
you-can-invite: "You can invite [number] more players." you-can-invite: "You can invite [number] more players."

View File

@ -134,30 +134,48 @@ public class Settings implements ISettings<Settings> {
// --------------------------------------------- // ---------------------------------------------
/* ISLAND */ /* ISLAND */
private int maxTeamSize; @ConfigEntry(path = "island.max-team-size")
private int maxHomes; private int maxTeamSize = 4;
@ConfigEntry(path = "island.max-homes")
private int maxHomes = 5;
@ConfigEntry(path = "island.name.min-length")
private int nameMinLength; private int nameMinLength;
@ConfigEntry(path = "island.name.max-length")
private int nameMaxLength; private int nameMaxLength;
private int inviteWait; @ConfigEntry(path = "island.invite-wait")
private int inviteWait = 60;
// Reset // Reset
private int resetLimit; @ConfigEntry(path = "island.reset.reset-limit")
private int resetLimit = -1;
@ConfigEntry(path = "island.require-confirmation.reset") @ConfigEntry(path = "island.require-confirmation.reset")
private boolean resetConfirmation; private boolean resetConfirmation;
@ConfigEntry(path = "island.require-confirmation.reset-wait") @ConfigEntry(path = "island.reset-wait")
private long resetWait; private long resetWait = 300;
@ConfigEntry(path = "island.reset.leavers-lose-reset")
private boolean leaversLoseReset; private boolean leaversLoseReset;
@ConfigEntry(path = "island.reset.kicked-keep-inventory")
private boolean kickedKeepInventory; private boolean kickedKeepInventory;
// Remove mobs // Remove mobs
@ConfigEntry(path = "island.remove-mobs.on-login")
private boolean removeMobsOnLogin; private boolean removeMobsOnLogin;
@ConfigEntry(path = "island.remove-mobs.on-island")
private boolean removeMobsOnIsland; private boolean removeMobsOnIsland;
@ConfigEntry(path = "island.remove-mobs.whitelist")
private List<String> removeMobsWhitelist = new ArrayList<>(); private List<String> removeMobsWhitelist = new ArrayList<>();
@ConfigEntry(path = "island.make-island-if-none")
private boolean makeIslandIfNone; private boolean makeIslandIfNone;
@ConfigEntry(path = "island.immediate-teleport-on-island")
private boolean immediateTeleportOnIsland; private boolean immediateTeleportOnIsland;
private boolean respawnOnIsland; private boolean respawnOnIsland;
// Deaths // Deaths

View File

@ -48,9 +48,9 @@ public class IslandTeamInviteCommand extends AbstractIslandTeamCommand {
// Invite label with no name, i.e., /island invite - tells the player who has invited them so far // Invite label with no name, i.e., /island invite - tells the player who has invited them so far
if (inviteList.containsKey(playerUUID)) { if (inviteList.containsKey(playerUUID)) {
OfflinePlayer inviter = getPlugin().getServer().getOfflinePlayer(inviteList.get(playerUUID)); OfflinePlayer inviter = getPlugin().getServer().getOfflinePlayer(inviteList.get(playerUUID));
user.sendMessage("invite.nameHasInvitedYou", "[name]", inviter.getName()); user.sendMessage("commands.island.team.invite.name-has-invited-you", "[name]", inviter.getName());
} else { } else {
user.sendMessage("help.island.invite"); this.getSubCommand("help").get().execute(user, args);
} }
return true; return true;
} else { } else {
@ -67,19 +67,19 @@ public class IslandTeamInviteCommand extends AbstractIslandTeamCommand {
} }
// Player cannot invite themselves // Player cannot invite themselves
if (playerUUID.equals(invitedPlayerUUID)) { if (playerUUID.equals(invitedPlayerUUID)) {
user.sendMessage("invite.error.YouCannotInviteYourself"); user.sendMessage("commands.island.team.invite.cannot-invite-self");
return true; return true;
} }
// Check if this player can be invited to this island, or // Check if this player can be invited to this island, or
// whether they are still on cooldown // whether they are still on cooldown
long time = getPlayers().getInviteCoolDownTime(invitedPlayerUUID, getIslands().getIslandLocation(playerUUID)); long time = getPlayers().getInviteCoolDownTime(invitedPlayerUUID, getIslands().getIslandLocation(playerUUID));
if (time > 0 && !user.isOp()) { if (time > 0 && !user.isOp()) {
user.sendMessage("invite.error.CoolDown", "[time]", String.valueOf(time)); user.sendMessage("commands.island.team.invite.cooldown", "[time]", String.valueOf(time));
return true; return true;
} }
// Player cannot invite someone already on a team // Player cannot invite someone already on a team
if (getPlayers().inTeam(invitedPlayerUUID)) { if (getPlayers().inTeam(invitedPlayerUUID)) {
user.sendMessage("invite.error.ThatPlayerIsAlreadyInATeam"); user.sendMessage("commands.island.team.invite.already-on-team");
return true; return true;
} }
Set<UUID> teamMembers = getMembers(user); Set<UUID> teamMembers = getMembers(user);
@ -111,7 +111,7 @@ public class IslandTeamInviteCommand extends AbstractIslandTeamCommand {
// Players can only have one invite one at a time - interesting // Players can only have one invite one at a time - interesting
if (inviteList.containsValue(playerUUID)) { if (inviteList.containsValue(playerUUID)) {
inviteList.inverse().remove(playerUUID); inviteList.inverse().remove(playerUUID);
user.sendMessage("invite.removingInvite"); user.sendMessage("commands.island.team.invite.removing-invite");
} }
// Fire event so add-ons can run commands, etc. // Fire event so add-ons can run commands, etc.
IslandBaseEvent event = TeamEvent.builder() IslandBaseEvent event = TeamEvent.builder()
@ -124,15 +124,15 @@ public class IslandTeamInviteCommand extends AbstractIslandTeamCommand {
// Put the invited player (key) onto the list with inviter (value) // Put the invited player (key) onto the list with inviter (value)
// If someone else has invited a player, then this invite will overwrite the previous invite! // If someone else has invited a player, then this invite will overwrite the previous invite!
inviteList.put(invitedPlayerUUID, playerUUID); inviteList.put(invitedPlayerUUID, playerUUID);
user.sendMessage("invite.inviteSentTo", "[name]", args.get(0)); user.sendMessage("commands.island.team.invite.invitation-sent", "[name]", args.get(0));
// Send message to online player // Send message to online player
invitedPlayer.sendMessage("invite.nameHasInvitedYou", "[name]", user.getName()); invitedPlayer.sendMessage("commands.island.team.invite.name-has-invited-you", "[name]", user.getName());
invitedPlayer.sendMessage("invite.toAcceptOrReject", "[label]", getLabel()); invitedPlayer.sendMessage("commands.island.team.invite.to-accept-or-reject", "[label]", getLabel());
if (getPlayers().hasIsland(invitedPlayer.getUniqueId())) { if (getPlayers().hasIsland(invitedPlayer.getUniqueId())) {
invitedPlayer.sendMessage("invite.warningYouWillLoseIsland"); invitedPlayer.sendMessage("commands.island.team.invite.you-will-lose-your-island");
} }
} else { } else {
user.sendMessage("invite.error.YourIslandIsFull"); user.sendMessage("commands.island.team.invite.errors.island-is-full");
} }
} }
return false; return false;