Ver código fonte

Making HUD a bit more friendly

nossr50 13 anos atrás
pai
commit
bd7203dd9c

+ 2 - 2
src/main/java/com/gmail/nossr50/config/Config.java

@@ -5,7 +5,7 @@ import com.gmail.nossr50.datatypes.HUDType;
 
 public class Config extends ConfigLoader {
     public int xpGainMultiplier = 1;
-    private static volatile Config instance;
+    private static Config instance;
 
     public static Config getInstance() {
         if (instance == null) {
@@ -351,7 +351,7 @@ public class Config extends ConfigLoader {
         String temp = config.getString("Spout.HUD.Default", "STANDARD");
         
         for (HUDType x : HUDType.values()) {
-            if (x.toString().equalsIgnoreCase(temp)) {
+            if (x.toString().toLowerCase().equalsIgnoreCase(temp.toString().toLowerCase())) {
                 defaulthud = x;
             }
         }

+ 1 - 0
src/main/java/com/gmail/nossr50/datatypes/PlayerProfile.java

@@ -298,6 +298,7 @@ public class PlayerProfile {
         Long timestamp = System.currentTimeMillis() / 1000; //Convert to seconds
         // if we are using mysql save to database
         if (Config.getInstance().getUseMySQL()) {
+            
             mcMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"huds SET hudtype = '"+hud.toString()+"' WHERE user_id = "+this.userid);
             mcMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"users SET lastlogin = " + timestamp.intValue() + " WHERE id = " + this.userid);
             mcMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"users SET party = '"+this.party+"' WHERE id = " +this.userid);

+ 1 - 1
src/main/java/com/gmail/nossr50/util/Users.java

@@ -106,7 +106,7 @@ public class Users {
      */
     public static PlayerProfile getProfileByName(String playerName) {
         if (mcMMO.p.getServer().getOfflinePlayer(playerName).isOnline() || players.containsKey(playerName.toLowerCase())) {
-            if (players.get(playerName.toLowerCase()) != null) {
+            if (players.containsKey(playerName.toLowerCase())) {
                 return players.get(playerName.toLowerCase());
             }
             else {