Making HUD a bit more friendly

This commit is contained in:
nossr50 2012-04-27 23:38:16 -07:00
parent b46997bc1a
commit bd7203dd9c
3 changed files with 4 additions and 3 deletions

View File

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

View File

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

View File

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