mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Merge pull request #726 from CocoTheOwner/dimensionDefault
"Default" IrisDimension instead of "Overworld"
This commit is contained in:
commit
ac69d57de0
@ -60,7 +60,7 @@ public class CommandIris implements DecreeExecutor {
|
|||||||
public void create(
|
public void create(
|
||||||
@Param(aliases = "world-name", description = "The name of the world to create")
|
@Param(aliases = "world-name", description = "The name of the world to create")
|
||||||
String name,
|
String name,
|
||||||
@Param(aliases = "dimension", description = "The dimension type to create the world with", defaultValue = "overworld")
|
@Param(aliases = "dimension", description = "The dimension type to create the world with", defaultValue = "default")
|
||||||
IrisDimension type,
|
IrisDimension type,
|
||||||
@Param(description = "The seed to generate the world with", defaultValue = "1337")
|
@Param(description = "The seed to generate the world with", defaultValue = "1337")
|
||||||
long seed
|
long seed
|
||||||
|
@ -121,7 +121,7 @@ public class CommandStudio implements DecreeExecutor {
|
|||||||
|
|
||||||
@Decree(description = "Open a new studio world", aliases = "o", sync = true)
|
@Decree(description = "Open a new studio world", aliases = "o", sync = true)
|
||||||
public void open(
|
public void open(
|
||||||
@Param(defaultValue = "overworld", description = "The dimension to open a studio for", aliases = "dim")
|
@Param(defaultValue = "default", description = "The dimension to open a studio for", aliases = "dim")
|
||||||
IrisDimension dimension,
|
IrisDimension dimension,
|
||||||
@Param(defaultValue = "1337", description = "The seed to generate the studio with", aliases = "s")
|
@Param(defaultValue = "1337", description = "The seed to generate the studio with", aliases = "s")
|
||||||
long seed) {
|
long seed) {
|
||||||
@ -131,7 +131,7 @@ public class CommandStudio implements DecreeExecutor {
|
|||||||
|
|
||||||
@Decree(description = "Open VSCode for a dimension", aliases = {"vsc", "edit"})
|
@Decree(description = "Open VSCode for a dimension", aliases = {"vsc", "edit"})
|
||||||
public void vscode(
|
public void vscode(
|
||||||
@Param(defaultValue = "overworld", description = "The dimension to open VSCode for", aliases = "dim")
|
@Param(defaultValue = "default", description = "The dimension to open VSCode for", aliases = "dim")
|
||||||
IrisDimension dimension
|
IrisDimension dimension
|
||||||
) {
|
) {
|
||||||
sender().sendMessage(C.GREEN + "Opening VSCode for the \"" + dimension.getName() + "\" pack");
|
sender().sendMessage(C.GREEN + "Opening VSCode for the \"" + dimension.getName() + "\" pack");
|
||||||
@ -288,7 +288,7 @@ public class CommandStudio implements DecreeExecutor {
|
|||||||
|
|
||||||
@Decree(description = "Get the version of a pack")
|
@Decree(description = "Get the version of a pack")
|
||||||
public void version(
|
public void version(
|
||||||
@Param(defaultValue = "overworld", description = "The dimension get the version of", aliases = "dim", contextual = true)
|
@Param(defaultValue = "default", description = "The dimension get the version of", aliases = "dim", contextual = true)
|
||||||
IrisDimension dimension
|
IrisDimension dimension
|
||||||
) {
|
) {
|
||||||
sender().sendMessage(C.GREEN + "The \"" + dimension.getName() + "\" pack has version: " + dimension.getVersion());
|
sender().sendMessage(C.GREEN + "The \"" + dimension.getName() + "\" pack has version: " + dimension.getVersion());
|
||||||
@ -417,7 +417,7 @@ public class CommandStudio implements DecreeExecutor {
|
|||||||
|
|
||||||
@Decree(description = "Package a dimension into a compressed format", aliases = "package")
|
@Decree(description = "Package a dimension into a compressed format", aliases = "package")
|
||||||
public void pkg(
|
public void pkg(
|
||||||
@Param(name = "dimension", description = "The dimension pack to compress", contextual = true, defaultValue = "overworld")
|
@Param(name = "dimension", description = "The dimension pack to compress", contextual = true, defaultValue = "default")
|
||||||
IrisDimension dimension,
|
IrisDimension dimension,
|
||||||
@Param(name = "obfuscate", description = "Whether or not to obfuscate the pack", defaultValue = "false")
|
@Param(name = "obfuscate", description = "Whether or not to obfuscate the pack", defaultValue = "false")
|
||||||
boolean obfuscate,
|
boolean obfuscate,
|
||||||
@ -429,7 +429,7 @@ public class CommandStudio implements DecreeExecutor {
|
|||||||
|
|
||||||
@Decree(description = "Profiles the performance of a dimension", origin = DecreeOrigin.PLAYER)
|
@Decree(description = "Profiles the performance of a dimension", origin = DecreeOrigin.PLAYER)
|
||||||
public void profile(
|
public void profile(
|
||||||
@Param(description = "The dimension to profile", contextual = true, defaultValue = "overworld")
|
@Param(description = "The dimension to profile", contextual = true, defaultValue = "default")
|
||||||
IrisDimension dimension
|
IrisDimension dimension
|
||||||
) {
|
) {
|
||||||
File pack = dimension.getLoadFile().getParentFile().getParentFile();
|
File pack = dimension.getLoadFile().getParentFile().getParentFile();
|
||||||
@ -650,7 +650,7 @@ public class CommandStudio implements DecreeExecutor {
|
|||||||
|
|
||||||
@Decree(description = "Update your dimension projects VSCode workspace")
|
@Decree(description = "Update your dimension projects VSCode workspace")
|
||||||
public void update(
|
public void update(
|
||||||
@Param(description = "The dimension to update the workspace of", contextual = true, defaultValue = "overworld")
|
@Param(description = "The dimension to update the workspace of", contextual = true, defaultValue = "default")
|
||||||
IrisDimension dimension
|
IrisDimension dimension
|
||||||
) {
|
) {
|
||||||
sender().sendMessage(C.GOLD + "Updating Code Workspace for " + dimension.getName() + "...");
|
sender().sendMessage(C.GOLD + "Updating Code Workspace for " + dimension.getName() + "...");
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
package com.volmit.iris.util.decree.handlers;
|
package com.volmit.iris.util.decree.handlers;
|
||||||
|
|
||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
|
import com.volmit.iris.core.IrisSettings;
|
||||||
import com.volmit.iris.core.loader.IrisData;
|
import com.volmit.iris.core.loader.IrisData;
|
||||||
import com.volmit.iris.engine.object.IrisDimension;
|
import com.volmit.iris.engine.object.IrisDimension;
|
||||||
import com.volmit.iris.util.collection.KList;
|
import com.volmit.iris.util.collection.KList;
|
||||||
@ -56,13 +57,19 @@ public class DimensionHandler implements DecreeParameterHandler<IrisDimension> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IrisDimension parse(String in, boolean force) throws DecreeParsingException {
|
public IrisDimension parse(String in, boolean force) throws DecreeParsingException {
|
||||||
|
|
||||||
|
if(in.equalsIgnoreCase("default")) {
|
||||||
|
return parse(IrisSettings.get().getGenerator().getDefaultWorldType());
|
||||||
|
}
|
||||||
|
|
||||||
KList<IrisDimension> options = getPossibilities(in);
|
KList<IrisDimension> options = getPossibilities(in);
|
||||||
|
|
||||||
|
|
||||||
if(options.isEmpty()) {
|
if(options.isEmpty()) {
|
||||||
throw new DecreeParsingException("Unable to find Dimension \"" + in + "\"");
|
throw new DecreeParsingException("Unable to find Dimension \"" + in + "\"");
|
||||||
}
|
}
|
||||||
try {
|
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) {
|
} catch(Throwable e) {
|
||||||
throw new DecreeParsingException("Unable to filter which Biome \"" + in + "\"");
|
throw new DecreeParsingException("Unable to filter which Biome \"" + in + "\"");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user