Fix Price not being able to be set. Closes #45

This commit is contained in:
Eric Stokes 2011-07-29 23:17:17 -06:00
parent dd129f2776
commit 48f51e8a3a
2 changed files with 11 additions and 4 deletions

View File

@ -389,6 +389,13 @@ public class MVWorld {
} catch (Exception e) { } catch (Exception e) {
} }
} }
if (name.equalsIgnoreCase("price")) {
try {
double doubValue = Double.parseDouble(value);
return this.setPrice(doubValue);
} catch (Exception e) {
}
}
try { try {
boolean boolValue = Boolean.parseBoolean(value); boolean boolValue = Boolean.parseBoolean(value);
return this.setVariable(name, boolValue); return this.setVariable(name, boolValue);
@ -575,16 +582,18 @@ public class MVWorld {
return this.price; return this.price;
} }
private void setCurrency(int currency) { private boolean setCurrency(int currency) {
this.currency = currency; this.currency = currency;
config.getInt("worlds." + this.name + ".entryfee.currency", currency); config.getInt("worlds." + this.name + ".entryfee.currency", currency);
config.save(); config.save();
return true;
} }
private void setPrice(double price) { private boolean setPrice(double price) {
this.price = price; this.price = price;
config.setProperty("worlds." + this.name + ".entryfee.amount", price); config.setProperty("worlds." + this.name + ".entryfee.amount", price);
config.save(); config.save();
return true;
} }
public boolean isExempt(Player p) { public boolean isExempt(Player p) {

View File

@ -10,7 +10,6 @@ import org.bukkit.plugin.Plugin;
import org.bukkit.util.config.Configuration; import org.bukkit.util.config.Configuration;
import com.onarandombox.MultiverseCore.LoggablePlugin; import com.onarandombox.MultiverseCore.LoggablePlugin;
import com.onarandombox.MultiverseCore.MultiverseCore;
public abstract class MVConfigMigrator { public abstract class MVConfigMigrator {
public List<String> createdDefaults = new ArrayList<String>(); public List<String> createdDefaults = new ArrayList<String>();
@ -43,7 +42,6 @@ public abstract class MVConfigMigrator {
mvPlugin.log(Level.INFO, "Found the MultiVerse 1 config folder. Starting Config Migration..."); mvPlugin.log(Level.INFO, "Found the MultiVerse 1 config folder. Starting Config Migration...");
oldFolder = f; oldFolder = f;
} }
} }
if (oldFolder == null) { if (oldFolder == null) {
mvPlugin.log(Level.INFO, "Did not find the MV1 Folder. If you did not have MultiVerse 1 installed and this is the FIRST time you're running MV2, this message is GOOD. "); mvPlugin.log(Level.INFO, "Did not find the MV1 Folder. If you did not have MultiVerse 1 installed and this is the FIRST time you're running MV2, this message is GOOD. ");