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

View File

@ -10,7 +10,6 @@ import org.bukkit.plugin.Plugin;
import org.bukkit.util.config.Configuration;
import com.onarandombox.MultiverseCore.LoggablePlugin;
import com.onarandombox.MultiverseCore.MultiverseCore;
public abstract class MVConfigMigrator {
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...");
oldFolder = f;
}
}
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. ");