Merge branch 'configurable' into api

This commit is contained in:
Shane Freeder 2019-10-06 01:34:55 +01:00
commit 1fbcf698c6
No known key found for this signature in database
GPG Key ID: A3F61EA5A085289C
6 changed files with 10 additions and 30 deletions

View File

@ -223,10 +223,10 @@ public abstract class SkillCommand implements TabExecutor {
String statDescriptionKey = !isExtra ? subSkillType.getLocaleKeyStatDescription(pluginRef) : subSkillType.getLocaleKeyStatExtraDescription(pluginRef); String statDescriptionKey = !isExtra ? subSkillType.getLocaleKeyStatDescription(pluginRef) : subSkillType.getLocaleKeyStatExtraDescription(pluginRef);
if (isCustom) if (isCustom)
return pluginRef.getLocaleManager().getString(templateKey, pluginRef.getLocaleManager().getString(statDescriptionKey, vars)); return pluginRef.getLocaleManager().getString(templateKey, pluginRef.getLocaleManager().getString(statDescriptionKey, (Object[]) vars));
else { else {
String[] mergedList = pluginRef.getNotificationManager().addItemToFirstPositionOfArray(pluginRef.getLocaleManager().getString(statDescriptionKey), vars); String[] mergedList = pluginRef.getNotificationManager().addItemToFirstPositionOfArray(pluginRef.getLocaleManager().getString(statDescriptionKey), vars);
return pluginRef.getLocaleManager().getString(templateKey, mergedList); return pluginRef.getLocaleManager().getString(templateKey, (Object[]) mergedList);
} }
} }

View File

@ -530,11 +530,6 @@ public final class FlatFileDatabaseManager implements DatabaseManager {
// Didn't find the player, create a new one // Didn't find the player, create a new one
if (create) { if (create) {
if (uuid == null) {
newUser(playerName, uuid);
return new PlayerProfile(pluginRef, playerName, true);
}
newUser(playerName, uuid); newUser(playerName, uuid);
return new PlayerProfile(pluginRef, playerName, uuid, true); return new PlayerProfile(pluginRef, playerName, uuid, true);
} }
@ -554,10 +549,6 @@ public final class FlatFileDatabaseManager implements DatabaseManager {
} }
// Return unloaded profile // Return unloaded profile
if (uuid == null) {
return new PlayerProfile(pluginRef, playerName);
}
return new PlayerProfile(pluginRef, playerName, uuid); return new PlayerProfile(pluginRef, playerName, uuid);
} }

View File

@ -564,10 +564,10 @@ public final class SQLDatabaseManager implements DatabaseManager {
id = newUser(connection, playerName, uuid); id = newUser(connection, playerName, uuid);
create = false; create = false;
if (id == -1) { if (id == -1) {
return new PlayerProfile(pluginRef, playerName, false); return new PlayerProfile(pluginRef, playerName, uuid, false);
} }
} else { } else {
return new PlayerProfile(pluginRef, playerName, false); return new PlayerProfile(pluginRef, playerName, uuid,false);
} }
} }
// There is such a user // There is such a user
@ -634,7 +634,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
// return unloaded profile // return unloaded profile
if (!retry) { if (!retry) {
return new PlayerProfile(pluginRef, playerName, false); return new PlayerProfile(pluginRef, playerName, uuid, false);
} }
// Retry, and abort on re-failure // Retry, and abort on re-failure

View File

@ -34,11 +34,6 @@ public class PlayerProfile {
private HashMap<PrimarySkillType, Double> rollingSkillsXp = new HashMap<PrimarySkillType, Double>(); private HashMap<PrimarySkillType, Double> rollingSkillsXp = new HashMap<PrimarySkillType, Double>();
private final mcMMO pluginRef; private final mcMMO pluginRef;
@Deprecated
public PlayerProfile(mcMMO pluginRef, String playerName) {
this(pluginRef, playerName, null);
}
public PlayerProfile(mcMMO pluginRef, String playerName, UUID uuid) { public PlayerProfile(mcMMO pluginRef, String playerName, UUID uuid) {
this.pluginRef = pluginRef; this.pluginRef = pluginRef;
this.uuid = uuid; this.uuid = uuid;
@ -60,12 +55,6 @@ public class PlayerProfile {
uniquePlayerData.put(UniqueDataType.CHIMAERA_WING_DATS, 0); //Chimaera wing uniquePlayerData.put(UniqueDataType.CHIMAERA_WING_DATS, 0); //Chimaera wing
} }
@Deprecated
public PlayerProfile(mcMMO pluginRef, String playerName, boolean isLoaded) {
this(pluginRef, playerName);
this.loaded = isLoaded;
}
public PlayerProfile(mcMMO pluginRef, String playerName, UUID uuid, boolean isLoaded) { public PlayerProfile(mcMMO pluginRef, String playerName, UUID uuid, boolean isLoaded) {
this(pluginRef, playerName, uuid); this(pluginRef, playerName, uuid);
this.loaded = isLoaded; this.loaded = isLoaded;

View File

@ -75,7 +75,7 @@ public final class CommandTools {
return true; return true;
} }
PlayerProfile profile = new PlayerProfile(pluginRef, playerName, false); PlayerProfile profile = new PlayerProfile(pluginRef, playerName, null, false);
if (unloadedProfile(sender, profile)) { if (unloadedProfile(sender, profile)) {
return false; return false;

View File

@ -214,12 +214,12 @@ public class NotificationManager {
//Send the notification //Send the notification
switch (sensitiveCommandType) { switch (sensitiveCommandType) {
case XPRATE_MODIFY: case XPRATE_MODIFY:
sendAdminNotification(pluginRef.getLocaleManager().getString("Notifications.Admin.XPRate.Start.Others", addItemToFirstPositionOfArray(senderName, args))); sendAdminNotification(pluginRef.getLocaleManager().getString("Notifications.Admin.XPRate.Start.Others", (Object[]) addItemToFirstPositionOfArray(senderName, args)));
sendAdminCommandConfirmation(commandSender, pluginRef.getLocaleManager().getString("Notifications.Admin.XPRate.Start.Self", args)); sendAdminCommandConfirmation(commandSender, pluginRef.getLocaleManager().getString("Notifications.Admin.XPRate.Start.Self", (Object[]) args));
break; break;
case XPRATE_END: case XPRATE_END:
sendAdminNotification(pluginRef.getLocaleManager().getString("Notifications.Admin.XPRate.End.Others", addItemToFirstPositionOfArray(senderName, args))); sendAdminNotification(pluginRef.getLocaleManager().getString("Notifications.Admin.XPRate.End.Others", (Object[]) addItemToFirstPositionOfArray(senderName, args)));
sendAdminCommandConfirmation(commandSender, pluginRef.getLocaleManager().getString("Notifications.Admin.XPRate.End.Self", args)); sendAdminCommandConfirmation(commandSender, pluginRef.getLocaleManager().getString("Notifications.Admin.XPRate.End.Self", (Object[]) args));
break; break;
} }
} }