mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-22 10:36:06 +01:00
Merge pull request #2494 from benwoo1110/property-fix
Fix cannot remove block currency with mvm set command.
This commit is contained in:
commit
7c59dcbcb9
@ -22,6 +22,8 @@ public class EntryFee extends SerializationConfig {
|
||||
@Nullable
|
||||
private Material currency;
|
||||
|
||||
private final Material DISABLED_MATERIAL = Material.AIR;
|
||||
|
||||
public EntryFee() {
|
||||
super();
|
||||
}
|
||||
@ -51,6 +53,9 @@ public class EntryFee extends SerializationConfig {
|
||||
*/
|
||||
@Nullable
|
||||
public Material getCurrency() {
|
||||
if (currency == null || currency.equals(DISABLED_MATERIAL)) {
|
||||
return null;
|
||||
}
|
||||
return currency;
|
||||
}
|
||||
|
||||
|
@ -50,6 +50,10 @@ public class TestEntryFeeConversion {
|
||||
WorldProperties props = new WorldProperties(config);
|
||||
assertNull(props.entryfee.getCurrency());
|
||||
|
||||
entryFee.put("currency", 0);
|
||||
props = new WorldProperties(config);
|
||||
assertNull(props.entryfee.getCurrency());
|
||||
|
||||
entryFee.put("currency", 1);
|
||||
props = new WorldProperties(config);
|
||||
assertEquals(Material.STONE, props.entryfee.getCurrency());
|
||||
|
Loading…
Reference in New Issue
Block a user