mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-26 04:25:37 +01:00
Fix Price not being able to be set. Closes #45
This commit is contained in:
parent
dd129f2776
commit
48f51e8a3a
@ -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) {
|
||||||
|
@ -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. ");
|
||||||
|
Loading…
Reference in New Issue
Block a user