mirror of
https://github.com/TotalFreedomMC/TF-Marriage.git
synced 2024-12-27 18:44:20 +00:00
Merge pull request #1 from DragonSlayer2189/patch-1
Rename Unknown to None and also fix command errors
This commit is contained in:
commit
24b43d47d3
5 changed files with 11 additions and 11 deletions
|
@ -4,7 +4,7 @@ import com.lenis0012.bukkit.marriage2.config.Settings;
|
|||
|
||||
public enum Gender {
|
||||
/**
|
||||
* Opposite of femaile
|
||||
* Opposite of female
|
||||
*/
|
||||
MALE,
|
||||
/**
|
||||
|
@ -14,7 +14,7 @@ public enum Gender {
|
|||
/**
|
||||
* Not set
|
||||
*/
|
||||
UNKNOWN;
|
||||
NONE;
|
||||
|
||||
/**
|
||||
* Get chat prefix for gender.
|
||||
|
@ -31,4 +31,4 @@ public enum Gender {
|
|||
return Settings.PREFIX_GENDERLESS.value();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ public class CommandGender extends Command {
|
|||
}
|
||||
|
||||
MPlayer mPlayer = marriage.getMPlayer(player);
|
||||
if(mPlayer.getGender() != Gender.UNKNOWN && !Settings.ALLOW_GENDER_CHANGE.value()) {
|
||||
if(mPlayer.getGender() != Gender.NONE && !Settings.ALLOW_GENDER_CHANGE.value()) {
|
||||
reply(Message.GENDER_ALREADY_CHANGED);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ public enum Message {
|
|||
FETCHING_LIST("&eFetching player marriage list..."),
|
||||
HOME_SET("&aYou have set a home for your marriage!"),
|
||||
INVALID_FORMAT("&cThe argument could not be parsed to an integer!"),
|
||||
INVALID_GENDER("&cThat is not a valid gender! Pick \"male\" or \"female\""),
|
||||
INVALID_GENDER("&cThat is not a valid gender! Pick \"male\", \"female\" or \"none\"."),
|
||||
GENDER_SET("&aYour gender has been set to %s!"),
|
||||
MARRY_SELF("&cYou cannot marry yourself!"),
|
||||
NEGATIVE_NUMBER("&cYou must enter a positive number!"),
|
||||
|
|
|
@ -22,7 +22,7 @@ public class MarriagePlayer implements MPlayer {
|
|||
private final UUID uuid;
|
||||
private String lastName;
|
||||
private MData marriage;
|
||||
private Gender gender = Gender.UNKNOWN;
|
||||
private Gender gender = Gender.NONE;
|
||||
private boolean inChat;
|
||||
private boolean chatSpy;
|
||||
private boolean priest;
|
||||
|
@ -164,4 +164,4 @@ public class MarriagePlayer implements MPlayer {
|
|||
public void setChatSpy(boolean chatSpy) {
|
||||
this.chatSpy = chatSpy;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ public class ListQuery {
|
|||
to.sendMessage(ChatColor.GOLD + ChatColor.BOLD.toString() + "Married players:");
|
||||
to.sendMessage(ChatColor.GOLD + "Page " + (page + 1) + "/" + pages);
|
||||
if(Settings.GENDER_IN_LIST.value()) {
|
||||
to.sendMessage(ChatColor.translateAlternateColorCodes('&', "&bmale &f- &dfemale &f- &7unknown"));
|
||||
to.sendMessage(ChatColor.translateAlternateColorCodes('&', "&bmale &f- &dfemale &f- &7none"));
|
||||
}
|
||||
for(MData data : marriages) {
|
||||
to.sendMessage(names.get(data.getPlayer1Id()) + ChatColor.WHITE + " + " + names.get(data.getPllayer2Id()));
|
||||
|
@ -79,7 +79,7 @@ public class ListQuery {
|
|||
ChatColor color = ChatColor.GREEN;
|
||||
if(Settings.GENDER_IN_LIST.value()) {
|
||||
MarriagePlayer mp = db.loadPlayer(userId);
|
||||
Gender gender = mp == null ? Gender.UNKNOWN : mp.getGender();
|
||||
Gender gender = mp == null ? Gender.NONE : mp.getGender();
|
||||
switch(gender) {
|
||||
case MALE:
|
||||
color = ChatColor.AQUA;
|
||||
|
@ -87,7 +87,7 @@ public class ListQuery {
|
|||
case FEMALE:
|
||||
color = ChatColor.LIGHT_PURPLE;
|
||||
break;
|
||||
case UNKNOWN:
|
||||
case NONE:
|
||||
color = ChatColor.GRAY;
|
||||
break;
|
||||
}
|
||||
|
@ -133,4 +133,4 @@ public class ListQuery {
|
|||
return null; // Complete failure
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue