mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 10:12:53 +00:00
Allow default to be used for IrisDimensions
This commit is contained in:
parent
2ead5b3c40
commit
5f165d0a89
@ -19,6 +19,7 @@
|
||||
package com.volmit.iris.util.decree.handlers;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisSettings;
|
||||
import com.volmit.iris.core.loader.IrisData;
|
||||
import com.volmit.iris.engine.object.IrisDimension;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
@ -56,13 +57,19 @@ public class DimensionHandler implements DecreeParameterHandler<IrisDimension> {
|
||||
|
||||
@Override
|
||||
public IrisDimension parse(String in, boolean force) throws DecreeParsingException {
|
||||
|
||||
if(in.equalsIgnoreCase("default")) {
|
||||
return parse(IrisSettings.get().getGenerator().getDefaultWorldType());
|
||||
}
|
||||
|
||||
KList<IrisDimension> options = getPossibilities(in);
|
||||
|
||||
|
||||
if(options.isEmpty()) {
|
||||
throw new DecreeParsingException("Unable to find Dimension \"" + in + "\"");
|
||||
}
|
||||
try {
|
||||
return options.stream().filter((i) -> toString(i).equalsIgnoreCase(in)).collect(Collectors.toList()).get(0);
|
||||
return options.stream().filter((i) -> toString(i).equalsIgnoreCase(in)).toList().get(0);
|
||||
} catch(Throwable e) {
|
||||
throw new DecreeParsingException("Unable to filter which Biome \"" + in + "\"");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user