Fix PAPI issues when pronouns haven't been set
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
27b1fabd72
commit
c4ce5e7399
@ -70,8 +70,10 @@ public class PAPIManager extends PlaceholderExpansion
|
||||
return Cache.dbManager.getPronounFormat(pronounId);
|
||||
case "full_tag":
|
||||
pronounId = Cache.dbManager.getPlayerPronounId(player.getName(), 0);
|
||||
if(pronounId < 0) return "";
|
||||
String mainPronounFormat = Cache.dbManager.getPronounFormat(pronounId);
|
||||
pronounId = Cache.dbManager.getPlayerPronounId(player.getName(), 1);
|
||||
if(pronounId < 0) return "";
|
||||
String secondaryPronounFormat = Cache.dbManager.getPronounFormat(pronounId);
|
||||
return baseFormat.replace("%main%", mainPronounFormat)
|
||||
.replace("%secondary%", secondaryPronounFormat);
|
||||
|
@ -260,6 +260,8 @@ public class DatabaseManager
|
||||
}
|
||||
|
||||
public String getPronounFormat(int pronounId) {
|
||||
if(pronounId < 0) return "";
|
||||
|
||||
String query = "SELECT format FROM pronouns " +
|
||||
"WHERE id = " + pronounId + " " +
|
||||
"LIMIT 1;";
|
||||
|
Loading…
Reference in New Issue
Block a user