Merge pull request #1 from DragonSlayer2189/patch-1

Rename Unknown to None and also fix command errors
This commit is contained in:
speed 2020-12-02 20:39:28 -05:00 committed by GitHub
commit 24b43d47d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 11 deletions

View file

@ -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.

View file

@ -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);
}

View file

@ -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!"),

View file

@ -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;

View file

@ -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;
}