From bb1c0b8f686248d87043ef2210636531a0b46639 Mon Sep 17 00:00:00 2001 From: Brian Neumann-Fopiano Date: Sun, 15 Feb 2026 04:49:23 -0500 Subject: [PATCH] FIXES --- .../iris/core/commands/CommandDeveloper.java | 86 ++++++++++++++- .../iris/core/commands/CommandIris.java | 101 +++--------------- .../iris/core/commands/CommandStudio.java | 20 ++-- .../arcane/iris/core/tools/IrisToolbelt.java | 66 +++++++++++- .../util/common/decree/DecreeExecutor.java | 11 +- .../decree/handlers/DimensionHandler.java | 50 ++++++++- .../NullableDimensionHandler.java | 50 ++++++++- .../arcane/iris/util/project/agent/Agent.java | 7 +- .../arcane/iris/core/safeguard/task/Tasks.kt | 15 ++- .../core/nms/v1_20_R1/CustomBiomeSource.java | 4 +- .../core/nms/v1_20_R2/CustomBiomeSource.java | 4 +- .../core/nms/v1_20_R3/CustomBiomeSource.java | 4 +- .../core/nms/v1_20_R4/CustomBiomeSource.java | 4 +- .../core/nms/v1_21_R1/CustomBiomeSource.java | 4 +- .../core/nms/v1_21_R2/CustomBiomeSource.java | 4 +- .../core/nms/v1_21_R3/CustomBiomeSource.java | 4 +- .../core/nms/v1_21_R4/CustomBiomeSource.java | 4 +- .../core/nms/v1_21_R5/CustomBiomeSource.java | 4 +- .../core/nms/v1_21_R6/CustomBiomeSource.java | 4 +- .../core/nms/v1_21_R7/CustomBiomeSource.java | 4 +- 20 files changed, 318 insertions(+), 132 deletions(-) diff --git a/core/src/main/java/art/arcane/iris/core/commands/CommandDeveloper.java b/core/src/main/java/art/arcane/iris/core/commands/CommandDeveloper.java index 2d6c935fc..da50ebb76 100644 --- a/core/src/main/java/art/arcane/iris/core/commands/CommandDeveloper.java +++ b/core/src/main/java/art/arcane/iris/core/commands/CommandDeveloper.java @@ -22,11 +22,13 @@ import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import art.arcane.iris.Iris; +import art.arcane.iris.core.IrisSettings; import art.arcane.iris.core.ServerConfigurator; import art.arcane.iris.core.loader.IrisData; import art.arcane.iris.core.nms.INMS; import art.arcane.iris.core.nms.datapack.DataVersion; import art.arcane.iris.core.service.IrisEngineSVC; +import art.arcane.iris.core.service.StudioSVC; import art.arcane.iris.core.tools.IrisPackBenchmarking; import art.arcane.iris.core.tools.IrisToolbelt; import art.arcane.iris.engine.framework.Engine; @@ -95,6 +97,89 @@ public class CommandDeveloper implements DecreeExecutor { Iris.reportError(new Exception("This is a test")); } + @Decree(description = "QOL command to open an overworld studio world", sync = true) + public void so() { + sender().sendMessage(C.GREEN + "Opening studio for the \"Overworld\" pack (seed: 1337)"); + Iris.service(StudioSVC.class).open(sender(), 1337, "overworld"); + } + + @Decree(description = "Set aura spins") + public void aura( + @Param(description = "The h color value", defaultValue = "-20") + int h, + @Param(description = "The s color value", defaultValue = "7") + int s, + @Param(description = "The b color value", defaultValue = "8") + int b + ) { + IrisSettings.get().getGeneral().setSpinh(h); + IrisSettings.get().getGeneral().setSpins(s); + IrisSettings.get().getGeneral().setSpinb(b); + IrisSettings.get().forceSave(); + sender().sendMessage("Aura Spins updated to " + h + " " + s + " " + b); + } + + @Decree(description = "Bitwise calculations") + public void bitwise( + @Param(description = "The first value to run calculations on") + int value1, + @Param(description = "The operator: | & ^ << >> %") + String operator, + @Param(description = "The second value to run calculations on") + int value2 + ) { + Integer v = null; + switch (operator) { + case "|" -> v = value1 | value2; + case "&" -> v = value1 & value2; + case "^" -> v = value1 ^ value2; + case "%" -> v = value1 % value2; + case ">>" -> v = value1 >> value2; + case "<<" -> v = value1 << value2; + } + if (v == null) { + sender().sendMessage(C.RED + "The operator you entered: (" + operator + ") is invalid!"); + return; + } + sender().sendMessage(C.GREEN + "" + value1 + " " + C.GREEN + operator.replaceAll("<", "≺").replaceAll(">", "≻").replaceAll("%", "%") + " " + C.GREEN + value2 + C.GREEN + " returns " + C.GREEN + v); + } + + @Decree(description = "Update the pack of a world (UNSAFE!)", name = "update-world", aliases = "^world") + public void updateWorld( + @Param(description = "The world to update", contextual = true) + World world, + @Param(description = "The pack to install into the world", contextual = true, aliases = "dimension") + IrisDimension pack, + @Param(description = "Make sure to make a backup & read the warnings first!", defaultValue = "false", aliases = "c") + boolean confirm, + @Param(description = "Should Iris download the pack again for you", defaultValue = "false", name = "fresh-download", aliases = {"fresh", "new"}) + boolean freshDownload + ) { + if (!confirm) { + sender().sendMessage(new String[]{ + C.RED + "You should always make a backup before using this", + C.YELLOW + "Issues caused by this can be, but are not limited to:", + C.YELLOW + " - Broken chunks (cut-offs) between old and new chunks (before & after the update)", + C.YELLOW + " - Regenerated chunks that do not fit in with the old chunks", + C.YELLOW + " - Structures not spawning again when regenerating", + C.YELLOW + " - Caves not lining up", + C.YELLOW + " - Terrain layers not lining up", + C.RED + "Now that you are aware of the risks, and have made a back-up:", + C.RED + "/iris developer update-world " + world.getName() + " " + pack.getLoadKey() + " confirm=true" + }); + return; + } + + File folder = world.getWorldFolder(); + folder.mkdirs(); + + if (freshDownload) { + Iris.service(StudioSVC.class).downloadSearch(sender(), pack.getLoadKey(), false, true); + } + + Iris.service(StudioSVC.class).installIntoWorld(sender(), pack.getLoadKey(), folder); + } + @Decree(description = "Dev cmd to fix all the broken objects caused by faulty shrinkwarp") public void fixObjects( @Param(aliases = "dimension", description = "The dimension type to create the world with") @@ -577,4 +662,3 @@ public class CommandDeveloper implements DecreeExecutor { } } - diff --git a/core/src/main/java/art/arcane/iris/core/commands/CommandIris.java b/core/src/main/java/art/arcane/iris/core/commands/CommandIris.java index 38ca37374..ffade4d31 100644 --- a/core/src/main/java/art/arcane/iris/core/commands/CommandIris.java +++ b/core/src/main/java/art/arcane/iris/core/commands/CommandIris.java @@ -74,8 +74,8 @@ public class CommandIris implements DecreeExecutor { public void create( @Param(aliases = "world-name", description = "The name of the world to create") String name, - @Param(aliases = "dimension", description = "The dimension type to create the world with", defaultValue = "default") - IrisDimension type, + @Param(aliases = {"dimension", "pack"}, description = "The dimension/pack to create the world with", defaultValue = "default") + String type, @Param(description = "The seed to generate the world with", defaultValue = "1337") long seed, @Param(aliases = "main-world", description = "Whether or not to automatically use this world as the main world", defaultValue = "false") @@ -98,10 +98,22 @@ public class CommandIris implements DecreeExecutor { return; } + String resolvedType = type.equalsIgnoreCase("default") + ? IrisSettings.get().getGenerator().getDefaultWorldType() + : type; + + IrisDimension dimension = IrisToolbelt.getDimension(resolvedType); + if (dimension == null) { + sender().sendMessage(C.RED + "Could not find or download dimension \"" + resolvedType + "\"."); + sender().sendMessage(C.YELLOW + "Try one of: overworld, vanilla, flat, theend"); + sender().sendMessage(C.YELLOW + "Or download manually: /iris download IrisDimensions/" + resolvedType); + return; + } + try { worldCreation = true; IrisToolbelt.createWorld() - .dimension(type.getLoadKey()) + .dimension(dimension.getLoadKey()) .name(name) .seed(seed) .sender(sender()) @@ -197,12 +209,6 @@ public class CommandIris implements DecreeExecutor { } } - @Decree(description = "QOL command to open a overworld studio world.", sync = true) - public void so() { - sender().sendMessage(C.GREEN + "Opening studio for the \"Overworld\" pack (seed: 1337)"); - Iris.service(StudioSVC.class).open(sender(), 1337, "overworld"); - } - @Decree(description = "Check access of all worlds.", aliases = {"accesslist"}) public void worlds() { KList IrisWorlds = new KList<>(); @@ -317,47 +323,6 @@ public class CommandIris implements DecreeExecutor { return dir.delete(); } - @Decree(description = "Set aura spins") - public void aura( - @Param(description = "The h color value", defaultValue = "-20") - int h, - @Param(description = "The s color value", defaultValue = "7") - int s, - @Param(description = "The b color value", defaultValue = "8") - int b - ) { - IrisSettings.get().getGeneral().setSpinh(h); - IrisSettings.get().getGeneral().setSpins(s); - IrisSettings.get().getGeneral().setSpinb(b); - IrisSettings.get().forceSave(); - sender().sendMessage("Aura Spins updated to " + h + " " + s + " " + b); - } - - @Decree(description = "Bitwise calculations") - public void bitwise( - @Param(description = "The first value to run calculations on") - int value1, - @Param(description = "The operator: | & ^ ≺≺ ≻≻ %") - String operator, - @Param(description = "The second value to run calculations on") - int value2 - ) { - Integer v = null; - switch (operator) { - case "|" -> v = value1 | value2; - case "&" -> v = value1 & value2; - case "^" -> v = value1 ^ value2; - case "%" -> v = value1 % value2; - case ">>" -> v = value1 >> value2; - case "<<" -> v = value1 << value2; - } - if (v == null) { - sender().sendMessage(C.RED + "The operator you entered: (" + operator + ") is invalid!"); - return; - } - sender().sendMessage(C.GREEN + "" + value1 + " " + C.GREEN + operator.replaceAll("<", "≺").replaceAll(">", "≻").replaceAll("%", "%") + " " + C.GREEN + value2 + C.GREEN + " returns " + C.GREEN + v); - } - @Decree(description = "Toggle debug") public void debug( @Param(name = "on", description = "Whether or not debug should be on", defaultValue = "other") @@ -408,42 +373,6 @@ public class CommandIris implements DecreeExecutor { sender().sendMessage(C.GREEN + "Hotloaded settings"); } - @Decree(description = "Update the pack of a world (UNSAFE!)", name = "^world", aliases = "update-world") - public void updateWorld( - @Param(description = "The world to update", contextual = true) - World world, - @Param(description = "The pack to install into the world", contextual = true, aliases = "dimension") - IrisDimension pack, - @Param(description = "Make sure to make a backup & read the warnings first!", defaultValue = "false", aliases = "c") - boolean confirm, - @Param(description = "Should Iris download the pack again for you", defaultValue = "false", name = "fresh-download", aliases = {"fresh", "new"}) - boolean freshDownload - ) { - if (!confirm) { - sender().sendMessage(new String[]{ - C.RED + "You should always make a backup before using this", - C.YELLOW + "Issues caused by this can be, but are not limited to:", - C.YELLOW + " - Broken chunks (cut-offs) between old and new chunks (before & after the update)", - C.YELLOW + " - Regenerated chunks that do not fit in with the old chunks", - C.YELLOW + " - Structures not spawning again when regenerating", - C.YELLOW + " - Caves not lining up", - C.YELLOW + " - Terrain layers not lining up", - C.RED + "Now that you are aware of the risks, and have made a back-up:", - C.RED + "/iris ^world " + world.getName() + " " + pack.getLoadKey() + " confirm=true" - }); - return; - } - - File folder = world.getWorldFolder(); - folder.mkdirs(); - - if (freshDownload) { - Iris.service(StudioSVC.class).downloadSearch(sender(), pack.getLoadKey(), false, true); - } - - Iris.service(StudioSVC.class).installIntoWorld(sender(), pack.getLoadKey(), folder); - } - @Decree(description = "Unload an Iris World", origin = DecreeOrigin.PLAYER, sync = true) public void unloadWorld( @Param(description = "The world to unload") diff --git a/core/src/main/java/art/arcane/iris/core/commands/CommandStudio.java b/core/src/main/java/art/arcane/iris/core/commands/CommandStudio.java index 85ac107c1..587935847 100644 --- a/core/src/main/java/art/arcane/iris/core/commands/CommandStudio.java +++ b/core/src/main/java/art/arcane/iris/core/commands/CommandStudio.java @@ -35,6 +35,8 @@ import art.arcane.volmlib.util.collection.KMap; import art.arcane.volmlib.util.collection.KSet; import art.arcane.iris.util.decree.DecreeContext; import art.arcane.iris.util.decree.DecreeExecutor; +import art.arcane.iris.util.decree.handlers.DimensionHandler; +import art.arcane.iris.util.decree.specialhandlers.NullableDimensionHandler; import art.arcane.volmlib.util.decree.DecreeOrigin; import art.arcane.volmlib.util.decree.annotations.Decree; import art.arcane.volmlib.util.decree.annotations.Param; @@ -109,7 +111,7 @@ public class CommandStudio implements DecreeExecutor { @Decree(description = "Open a new studio world", aliases = "o", sync = true) public void open( - @Param(defaultValue = "default", description = "The dimension to open a studio for", aliases = "dim") + @Param(defaultValue = "default", description = "The dimension to open a studio for", aliases = "dim", customHandler = DimensionHandler.class) IrisDimension dimension, @Param(defaultValue = "1337", description = "The seed to generate the studio with", aliases = "s") long seed) { @@ -119,7 +121,7 @@ public class CommandStudio implements DecreeExecutor { @Decree(description = "Open VSCode for a dimension", aliases = {"vsc", "edit"}) public void vscode( - @Param(defaultValue = "default", description = "The dimension to open VSCode for", aliases = "dim") + @Param(defaultValue = "default", description = "The dimension to open VSCode for", aliases = "dim", customHandler = DimensionHandler.class) IrisDimension dimension ) { sender().sendMessage(C.GREEN + "Opening VSCode for the \"" + dimension.getName() + "\" pack"); @@ -141,7 +143,11 @@ public class CommandStudio implements DecreeExecutor { public void create( @Param(description = "The name of this new Iris Project.") String name, - @Param(description = "Copy the contents of an existing project in your packs folder and use it as a template in this new project.", contextual = true) + @Param( + description = "Copy the contents of an existing project in your packs folder and use it as a template in this new project.", + contextual = true, + customHandler = NullableDimensionHandler.class + ) IrisDimension template) { if (template != null) { Iris.service(StudioSVC.class).create(sender(), name, template.getLoadKey()); @@ -152,7 +158,7 @@ public class CommandStudio implements DecreeExecutor { @Decree(description = "Get the version of a pack") public void version( - @Param(defaultValue = "default", 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, customHandler = DimensionHandler.class) IrisDimension dimension ) { sender().sendMessage(C.GREEN + "The \"" + dimension.getName() + "\" pack has version: " + dimension.getVersion()); @@ -463,7 +469,7 @@ public class CommandStudio implements DecreeExecutor { @Decree(description = "Package a dimension into a compressed format", aliases = "package") public void pkg( - @Param(name = "dimension", description = "The dimension pack to compress", contextual = true, defaultValue = "default") + @Param(name = "dimension", description = "The dimension pack to compress", contextual = true, defaultValue = "default", customHandler = DimensionHandler.class) IrisDimension dimension, @Param(name = "obfuscate", description = "Whether or not to obfuscate the pack", defaultValue = "false") boolean obfuscate, @@ -475,7 +481,7 @@ public class CommandStudio implements DecreeExecutor { @Decree(description = "Profiles the performance of a dimension", origin = DecreeOrigin.PLAYER) public void profile( - @Param(description = "The dimension to profile", contextual = true, defaultValue = "default") + @Param(description = "The dimension to profile", contextual = true, defaultValue = "default", customHandler = DimensionHandler.class) IrisDimension dimension ) { // Todo: Make this more accurate @@ -700,7 +706,7 @@ public class CommandStudio implements DecreeExecutor { @Decree(description = "Update your dimension projects VSCode workspace") public void update( - @Param(description = "The dimension to update the workspace of", contextual = true, defaultValue = "default") + @Param(description = "The dimension to update the workspace of", contextual = true, defaultValue = "default", customHandler = DimensionHandler.class) IrisDimension dimension ) { sender().sendMessage(C.GOLD + "Updating Code Workspace for " + dimension.getName() + "..."); diff --git a/core/src/main/java/art/arcane/iris/core/tools/IrisToolbelt.java b/core/src/main/java/art/arcane/iris/core/tools/IrisToolbelt.java index 50b3274ac..d0a81f0f1 100644 --- a/core/src/main/java/art/arcane/iris/core/tools/IrisToolbelt.java +++ b/core/src/main/java/art/arcane/iris/core/tools/IrisToolbelt.java @@ -61,17 +61,77 @@ public class IrisToolbelt { * @return the IrisDimension or null */ public static IrisDimension getDimension(String dimension) { - File pack = Iris.instance.getDataFolder("packs", dimension); + if (dimension == null) { + return null; + } + + String requested = dimension.trim(); + if (requested.isEmpty()) { + return null; + } + + File packsFolder = Iris.instance.getDataFolder("packs"); + File pack = new File(packsFolder, requested); + if (!pack.exists()) { + File found = findCaseInsensitivePack(packsFolder, requested); + if (found != null) { + pack = found; + } + } if (!pack.exists()) { - Iris.service(StudioSVC.class).downloadSearch(new VolmitSender(Bukkit.getConsoleSender(), Iris.instance.getTag()), dimension, false, false); + Iris.service(StudioSVC.class).downloadSearch(new VolmitSender(Bukkit.getConsoleSender(), Iris.instance.getTag()), requested, false, false); + File found = findCaseInsensitivePack(packsFolder, requested); + if (found != null) { + pack = found; + } } if (!pack.exists()) { return null; } - return IrisData.get(pack).getDimensionLoader().load(dimension); + IrisData data = IrisData.get(pack); + IrisDimension resolved = data.getDimensionLoader().load(requested, false); + if (resolved != null) { + return resolved; + } + + String packName = pack.getName(); + if (!packName.equals(requested)) { + resolved = data.getDimensionLoader().load(packName, false); + if (resolved != null) { + return resolved; + } + } + + for (String key : data.getDimensionLoader().getPossibleKeys()) { + if (!key.equalsIgnoreCase(requested) && !key.equalsIgnoreCase(packName)) { + continue; + } + + resolved = data.getDimensionLoader().load(key, false); + if (resolved != null) { + return resolved; + } + } + + return null; + } + + private static File findCaseInsensitivePack(File packsFolder, String requested) { + File[] children = packsFolder.listFiles(); + if (children == null) { + return null; + } + + for (File child : children) { + if (child.isDirectory() && child.getName().equalsIgnoreCase(requested)) { + return child; + } + } + + return null; } /** diff --git a/core/src/main/java/art/arcane/iris/util/common/decree/DecreeExecutor.java b/core/src/main/java/art/arcane/iris/util/common/decree/DecreeExecutor.java index c07bfbe4b..b672b8e9b 100644 --- a/core/src/main/java/art/arcane/iris/util/common/decree/DecreeExecutor.java +++ b/core/src/main/java/art/arcane/iris/util/common/decree/DecreeExecutor.java @@ -32,7 +32,8 @@ public interface DecreeExecutor extends DecreeExecutorBase { } default Player player() { - return sender().player(); + VolmitSender sender = sender(); + return sender == null ? null : sender.player(); } default IrisData data() { @@ -44,8 +45,9 @@ public interface DecreeExecutor extends DecreeExecutorBase { } default Engine engine() { - if (sender().isPlayer() && IrisToolbelt.access(sender().player().getWorld()) != null) { - PlatformChunkGenerator gen = IrisToolbelt.access(sender().player().getWorld()); + VolmitSender sender = sender(); + if (sender != null && sender.isPlayer() && IrisToolbelt.access(sender.player().getWorld()) != null) { + PlatformChunkGenerator gen = IrisToolbelt.access(sender.player().getWorld()); if (gen != null) { return gen.getEngine(); } @@ -55,7 +57,8 @@ public interface DecreeExecutor extends DecreeExecutorBase { } default PlatformChunkGenerator access() { - if (sender().isPlayer()) { + VolmitSender sender = sender(); + if (sender != null && sender.isPlayer()) { return IrisToolbelt.access(world()); } return null; diff --git a/core/src/main/java/art/arcane/iris/util/common/decree/handlers/DimensionHandler.java b/core/src/main/java/art/arcane/iris/util/common/decree/handlers/DimensionHandler.java index 9d3d2b8bc..8c81e1a52 100644 --- a/core/src/main/java/art/arcane/iris/util/common/decree/handlers/DimensionHandler.java +++ b/core/src/main/java/art/arcane/iris/util/common/decree/handlers/DimensionHandler.java @@ -19,10 +19,14 @@ package art.arcane.iris.util.decree.handlers; import art.arcane.iris.core.IrisSettings; +import art.arcane.iris.core.tools.IrisToolbelt; import art.arcane.iris.engine.object.IrisDimension; +import art.arcane.volmlib.util.collection.KList; import art.arcane.volmlib.util.decree.exceptions.DecreeParsingException; import art.arcane.iris.util.decree.specialhandlers.RegistrantHandler; +import java.util.Locale; + public class DimensionHandler extends RegistrantHandler { public DimensionHandler() { super(IrisDimension.class, false); @@ -30,10 +34,50 @@ public class DimensionHandler extends RegistrantHandler { @Override public IrisDimension parse(String in, boolean force) throws DecreeParsingException { - if (in.equalsIgnoreCase("default")) { - return parse(IrisSettings.get().getGenerator().getDefaultWorldType()); + String key = in.trim(); + if (key.equalsIgnoreCase("default")) { + key = IrisSettings.get().getGenerator().getDefaultWorldType(); } - return super.parse(in, force); + + try { + return super.parse(key, force); + } catch (DecreeParsingException ignored) { + String normalized = key.toLowerCase(Locale.ROOT); + IrisDimension resolved = IrisToolbelt.getDimension(normalized); + if (resolved != null) { + return resolved; + } + + if (!normalized.equals(key)) { + resolved = IrisToolbelt.getDimension(key); + if (resolved != null) { + return resolved; + } + } + + throw ignored; + } + } + + @Override + public KList getPossibilities(String input) { + KList possibilities = super.getPossibilities(); + String normalizedInput = input == null ? "" : input.trim().toLowerCase(Locale.ROOT); + if (normalizedInput.isEmpty()) { + return possibilities; + } + + KList filtered = new KList<>(); + for (IrisDimension dimension : possibilities) { + if (dimension != null && dimension.getLoadKey() != null) { + String key = dimension.getLoadKey().toLowerCase(Locale.ROOT); + if (key.startsWith(normalizedInput)) { + filtered.add(dimension); + } + } + } + + return filtered; } @Override diff --git a/core/src/main/java/art/arcane/iris/util/common/decree/specialhandlers/NullableDimensionHandler.java b/core/src/main/java/art/arcane/iris/util/common/decree/specialhandlers/NullableDimensionHandler.java index f69a4fbc4..460ba3c37 100644 --- a/core/src/main/java/art/arcane/iris/util/common/decree/specialhandlers/NullableDimensionHandler.java +++ b/core/src/main/java/art/arcane/iris/util/common/decree/specialhandlers/NullableDimensionHandler.java @@ -19,9 +19,13 @@ package art.arcane.iris.util.decree.specialhandlers; import art.arcane.iris.core.IrisSettings; +import art.arcane.iris.core.tools.IrisToolbelt; import art.arcane.iris.engine.object.IrisDimension; +import art.arcane.volmlib.util.collection.KList; import art.arcane.volmlib.util.decree.exceptions.DecreeParsingException; +import java.util.Locale; + public class NullableDimensionHandler extends RegistrantHandler { public NullableDimensionHandler() { super(IrisDimension.class, true); @@ -29,10 +33,50 @@ public class NullableDimensionHandler extends RegistrantHandler { @Override public IrisDimension parse(String in, boolean force) throws DecreeParsingException { - if (in.equalsIgnoreCase("default")) { - return parse(IrisSettings.get().getGenerator().getDefaultWorldType()); + String key = in.trim(); + if (key.equalsIgnoreCase("default")) { + key = IrisSettings.get().getGenerator().getDefaultWorldType(); } - return super.parse(in, force); + + try { + return super.parse(key, force); + } catch (DecreeParsingException ignored) { + String normalized = key.toLowerCase(Locale.ROOT); + IrisDimension resolved = IrisToolbelt.getDimension(normalized); + if (resolved != null) { + return resolved; + } + + if (!normalized.equals(key)) { + resolved = IrisToolbelt.getDimension(key); + if (resolved != null) { + return resolved; + } + } + + throw ignored; + } + } + + @Override + public KList getPossibilities(String input) { + KList possibilities = super.getPossibilities(); + String normalizedInput = input == null ? "" : input.trim().toLowerCase(Locale.ROOT); + if (normalizedInput.isEmpty()) { + return possibilities; + } + + KList filtered = new KList<>(); + for (IrisDimension dimension : possibilities) { + if (dimension != null && dimension.getLoadKey() != null) { + String key = dimension.getLoadKey().toLowerCase(Locale.ROOT); + if (key.startsWith(normalizedInput)) { + filtered.add(dimension); + } + } + } + + return filtered; } @Override diff --git a/core/src/main/java/art/arcane/iris/util/project/agent/Agent.java b/core/src/main/java/art/arcane/iris/util/project/agent/Agent.java index 0b98ce2e0..69edd90fe 100644 --- a/core/src/main/java/art/arcane/iris/util/project/agent/Agent.java +++ b/core/src/main/java/art/arcane/iris/util/project/agent/Agent.java @@ -17,6 +17,10 @@ public class Agent { return ClassReloadingStrategy.of(getInstrumentation()); } + public static boolean isInstalled() { + return doGetInstrumentation() != null; + } + public static Instrumentation getInstrumentation() { Instrumentation instrumentation = doGetInstrumentation(); if (instrumentation == null) throw new IllegalStateException("The agent is not initialized or unavailable"); @@ -24,11 +28,12 @@ public class Agent { } public static boolean install() { - if (doGetInstrumentation() != null) + if (isInstalled()) return true; try { Files.copy(Iris.instance.getResource("agent.jar"), AGENT_JAR.toPath(), StandardCopyOption.REPLACE_EXISTING); Iris.info("Installing Java Agent..."); + Iris.info("Note: JVM [Attach Listener/ERROR] [STDERR] warning lines during this step are expected and not Iris errors."); ByteBuddyAgent.attach(AGENT_JAR, ByteBuddyAgent.ProcessProvider.ForCurrentVm.INSTANCE); } catch (Throwable e) { e.printStackTrace(); diff --git a/core/src/main/kotlin/art/arcane/iris/core/safeguard/task/Tasks.kt b/core/src/main/kotlin/art/arcane/iris/core/safeguard/task/Tasks.kt index ee2fd04e6..7ebd3ad9a 100644 --- a/core/src/main/kotlin/art/arcane/iris/core/safeguard/task/Tasks.kt +++ b/core/src/main/kotlin/art/arcane/iris/core/safeguard/task/Tasks.kt @@ -11,6 +11,7 @@ import art.arcane.iris.core.safeguard.task.Task.Companion.of import art.arcane.iris.util.agent.Agent import art.arcane.iris.util.misc.getHardware import org.bukkit.Bukkit +import java.util.Locale import java.util.stream.Collectors import javax.tools.ToolProvider import kotlin.properties.PropertyDelegateProvider @@ -75,7 +76,13 @@ private val version by task { } private val injection by task { - if (!Agent.install()) UNSTABLE.withDiagnostics( + if (!isPaperPreferredServer() && !Agent.isInstalled()) { + WARNING.withDiagnostics( + WARN.create("Java Agent"), + WARN.create("- Skipping dynamic Java agent attach on Spigot/Bukkit to avoid runtime agent warnings."), + WARN.create("- For full runtime injection support, run with -javaagent:" + Agent.AGENT_JAR.path + " or use Paper/Purpur.") + ) + } else if (!Agent.install()) UNSTABLE.withDiagnostics( ERROR.create("Java Agent"), ERROR.create("- Please enable dynamic agent loading by adding -XX:+EnableDynamicAgentLoading to your jvm arguments."), ERROR.create("- or add the jvm argument -javaagent:" + Agent.AGENT_JAR.path) @@ -132,7 +139,11 @@ val tasks = listOf( ) private val server get() = Bukkit.getServer() +private fun isPaperPreferredServer(): Boolean { + val name = server.name.lowercase(Locale.ROOT) + return name.contains("paper") || name.contains("purpur") || name.contains("pufferfish") +} private fun MutableList.addAll(vararg values: T) = values.forEach(this::add) fun task(action: () -> ValueWithDiagnostics) = PropertyDelegateProvider> { _, _ -> ReadOnlyProperty { _, property -> of(property.name, action) } -} \ No newline at end of file +} diff --git a/nms/v1_20_R1/src/main/java/art/arcane/iris/core/nms/v1_20_R1/CustomBiomeSource.java b/nms/v1_20_R1/src/main/java/art/arcane/iris/core/nms/v1_20_R1/CustomBiomeSource.java index 680a72e0f..cb0f2b4b7 100644 --- a/nms/v1_20_R1/src/main/java/art/arcane/iris/core/nms/v1_20_R1/CustomBiomeSource.java +++ b/nms/v1_20_R1/src/main/java/art/arcane/iris/core/nms/v1_20_R1/CustomBiomeSource.java @@ -55,7 +55,7 @@ public class CustomBiomeSource extends BiomeSource { if (i.isCustom()) { for (IrisBiomeCustom j : i.getCustomDerivitives()) { b.add(customRegistry.getHolder(customRegistry.getResourceKey(customRegistry - .get(new ResourceLocation(engine.getDimension().getLoadKey() + ":" + j.getId()))).get()).get()); + .get(new ResourceLocation(engine.getDimension().getLoadKey().toLowerCase(java.util.Locale.ROOT) + ":" + j.getId().toLowerCase(java.util.Locale.ROOT)))).get()).get()); } } else { b.add(CraftBlock.biomeToBiomeBase(registry, i.getVanillaDerivative())); @@ -125,7 +125,7 @@ public class CustomBiomeSource extends BiomeSource { for (IrisBiome i : engine.getAllBiomes()) { if (i.isCustom()) { for (IrisBiomeCustom j : i.getCustomDerivitives()) { - ResourceLocation resourceLocation = new ResourceLocation(engine.getDimension().getLoadKey() + ":" + j.getId()); + ResourceLocation resourceLocation = new ResourceLocation(engine.getDimension().getLoadKey().toLowerCase(java.util.Locale.ROOT) + ":" + j.getId().toLowerCase(java.util.Locale.ROOT)); Biome biome = customRegistry.get(resourceLocation); Optional> optionalBiomeKey = customRegistry.getResourceKey(biome); if (optionalBiomeKey.isEmpty()) { diff --git a/nms/v1_20_R2/src/main/java/art/arcane/iris/core/nms/v1_20_R2/CustomBiomeSource.java b/nms/v1_20_R2/src/main/java/art/arcane/iris/core/nms/v1_20_R2/CustomBiomeSource.java index 0346e241d..b071a87e0 100644 --- a/nms/v1_20_R2/src/main/java/art/arcane/iris/core/nms/v1_20_R2/CustomBiomeSource.java +++ b/nms/v1_20_R2/src/main/java/art/arcane/iris/core/nms/v1_20_R2/CustomBiomeSource.java @@ -54,7 +54,7 @@ public class CustomBiomeSource extends BiomeSource { if (i.isCustom()) { for (IrisBiomeCustom j : i.getCustomDerivitives()) { b.add(customRegistry.getHolder(customRegistry.getResourceKey(customRegistry - .get(new ResourceLocation(engine.getDimension().getLoadKey() + ":" + j.getId()))).get()).get()); + .get(new ResourceLocation(engine.getDimension().getLoadKey().toLowerCase(java.util.Locale.ROOT) + ":" + j.getId().toLowerCase(java.util.Locale.ROOT)))).get()).get()); } } else { b.add(NMSBinding.biomeToBiomeBase(registry, i.getVanillaDerivative())); @@ -124,7 +124,7 @@ public class CustomBiomeSource extends BiomeSource { for (IrisBiome i : engine.getAllBiomes()) { if (i.isCustom()) { for (IrisBiomeCustom j : i.getCustomDerivitives()) { - ResourceLocation resourceLocation = new ResourceLocation(engine.getDimension().getLoadKey() + ":" + j.getId()); + ResourceLocation resourceLocation = new ResourceLocation(engine.getDimension().getLoadKey().toLowerCase(java.util.Locale.ROOT) + ":" + j.getId().toLowerCase(java.util.Locale.ROOT)); Biome biome = customRegistry.get(resourceLocation); Optional> optionalBiomeKey = customRegistry.getResourceKey(biome); if (optionalBiomeKey.isEmpty()) { diff --git a/nms/v1_20_R3/src/main/java/art/arcane/iris/core/nms/v1_20_R3/CustomBiomeSource.java b/nms/v1_20_R3/src/main/java/art/arcane/iris/core/nms/v1_20_R3/CustomBiomeSource.java index 11a3efb8c..92b7ba2d6 100644 --- a/nms/v1_20_R3/src/main/java/art/arcane/iris/core/nms/v1_20_R3/CustomBiomeSource.java +++ b/nms/v1_20_R3/src/main/java/art/arcane/iris/core/nms/v1_20_R3/CustomBiomeSource.java @@ -54,7 +54,7 @@ public class CustomBiomeSource extends BiomeSource { if (i.isCustom()) { for (IrisBiomeCustom j : i.getCustomDerivitives()) { b.add(customRegistry.getHolder(customRegistry.getResourceKey(customRegistry - .get(new ResourceLocation(engine.getDimension().getLoadKey() + ":" + j.getId()))).get()).get()); + .get(new ResourceLocation(engine.getDimension().getLoadKey().toLowerCase(java.util.Locale.ROOT) + ":" + j.getId().toLowerCase(java.util.Locale.ROOT)))).get()).get()); } } else { b.add(NMSBinding.biomeToBiomeBase(registry, i.getVanillaDerivative())); @@ -124,7 +124,7 @@ public class CustomBiomeSource extends BiomeSource { for (IrisBiome i : engine.getAllBiomes()) { if (i.isCustom()) { for (IrisBiomeCustom j : i.getCustomDerivitives()) { - ResourceLocation resourceLocation = new ResourceLocation(engine.getDimension().getLoadKey() + ":" + j.getId()); + ResourceLocation resourceLocation = new ResourceLocation(engine.getDimension().getLoadKey().toLowerCase(java.util.Locale.ROOT) + ":" + j.getId().toLowerCase(java.util.Locale.ROOT)); Biome biome = customRegistry.get(resourceLocation); Optional> optionalBiomeKey = customRegistry.getResourceKey(biome); if (optionalBiomeKey.isEmpty()) { diff --git a/nms/v1_20_R4/src/main/java/art/arcane/iris/core/nms/v1_20_R4/CustomBiomeSource.java b/nms/v1_20_R4/src/main/java/art/arcane/iris/core/nms/v1_20_R4/CustomBiomeSource.java index 51a6ade1d..3885c0782 100644 --- a/nms/v1_20_R4/src/main/java/art/arcane/iris/core/nms/v1_20_R4/CustomBiomeSource.java +++ b/nms/v1_20_R4/src/main/java/art/arcane/iris/core/nms/v1_20_R4/CustomBiomeSource.java @@ -54,7 +54,7 @@ public class CustomBiomeSource extends BiomeSource { if (i.isCustom()) { for (IrisBiomeCustom j : i.getCustomDerivitives()) { b.add(customRegistry.getHolder(customRegistry.getResourceKey(customRegistry - .get(new ResourceLocation(engine.getDimension().getLoadKey() + ":" + j.getId()))).get()).get()); + .get(new ResourceLocation(engine.getDimension().getLoadKey().toLowerCase(java.util.Locale.ROOT) + ":" + j.getId().toLowerCase(java.util.Locale.ROOT)))).get()).get()); } } else { b.add(NMSBinding.biomeToBiomeBase(registry, i.getVanillaDerivative())); @@ -124,7 +124,7 @@ public class CustomBiomeSource extends BiomeSource { for (IrisBiome i : engine.getAllBiomes()) { if (i.isCustom()) { for (IrisBiomeCustom j : i.getCustomDerivitives()) { - ResourceLocation resourceLocation = new ResourceLocation(engine.getDimension().getLoadKey() + ":" + j.getId()); + ResourceLocation resourceLocation = new ResourceLocation(engine.getDimension().getLoadKey().toLowerCase(java.util.Locale.ROOT) + ":" + j.getId().toLowerCase(java.util.Locale.ROOT)); Biome biome = customRegistry.get(resourceLocation); Optional> optionalBiomeKey = customRegistry.getResourceKey(biome); if (optionalBiomeKey.isEmpty()) { diff --git a/nms/v1_21_R1/src/main/java/art/arcane/iris/core/nms/v1_21_R1/CustomBiomeSource.java b/nms/v1_21_R1/src/main/java/art/arcane/iris/core/nms/v1_21_R1/CustomBiomeSource.java index 42285b41b..6817584c7 100644 --- a/nms/v1_21_R1/src/main/java/art/arcane/iris/core/nms/v1_21_R1/CustomBiomeSource.java +++ b/nms/v1_21_R1/src/main/java/art/arcane/iris/core/nms/v1_21_R1/CustomBiomeSource.java @@ -54,7 +54,7 @@ public class CustomBiomeSource extends BiomeSource { if (i.isCustom()) { for (IrisBiomeCustom j : i.getCustomDerivitives()) { b.add(customRegistry.getHolder(customRegistry.getResourceKey(customRegistry - .get(ResourceLocation.fromNamespaceAndPath(engine.getDimension().getLoadKey(), j.getId()))).get()).get()); + .get(ResourceLocation.fromNamespaceAndPath(engine.getDimension().getLoadKey().toLowerCase(java.util.Locale.ROOT), j.getId().toLowerCase(java.util.Locale.ROOT)))).get()).get()); } } else { b.add(NMSBinding.biomeToBiomeBase(registry, i.getVanillaDerivative())); @@ -124,7 +124,7 @@ public class CustomBiomeSource extends BiomeSource { for (IrisBiome i : engine.getAllBiomes()) { if (i.isCustom()) { for (IrisBiomeCustom j : i.getCustomDerivitives()) { - ResourceLocation resourceLocation = ResourceLocation.fromNamespaceAndPath(engine.getDimension().getLoadKey(), j.getId()); + ResourceLocation resourceLocation = ResourceLocation.fromNamespaceAndPath(engine.getDimension().getLoadKey().toLowerCase(java.util.Locale.ROOT), j.getId().toLowerCase(java.util.Locale.ROOT)); Biome biome = customRegistry.get(resourceLocation); Optional> optionalBiomeKey = customRegistry.getResourceKey(biome); if (optionalBiomeKey.isEmpty()) { diff --git a/nms/v1_21_R2/src/main/java/art/arcane/iris/core/nms/v1_21_R2/CustomBiomeSource.java b/nms/v1_21_R2/src/main/java/art/arcane/iris/core/nms/v1_21_R2/CustomBiomeSource.java index 325a5d55a..6d9b14fe6 100644 --- a/nms/v1_21_R2/src/main/java/art/arcane/iris/core/nms/v1_21_R2/CustomBiomeSource.java +++ b/nms/v1_21_R2/src/main/java/art/arcane/iris/core/nms/v1_21_R2/CustomBiomeSource.java @@ -54,7 +54,7 @@ public class CustomBiomeSource extends BiomeSource { if (i.isCustom()) { for (IrisBiomeCustom j : i.getCustomDerivitives()) { b.add(customRegistry.get(customRegistry.getResourceKey(customRegistry - .getValue(ResourceLocation.fromNamespaceAndPath(engine.getDimension().getLoadKey(), j.getId()))).get()).get()); + .getValue(ResourceLocation.fromNamespaceAndPath(engine.getDimension().getLoadKey().toLowerCase(java.util.Locale.ROOT), j.getId().toLowerCase(java.util.Locale.ROOT)))).get()).get()); } } else { b.add(NMSBinding.biomeToBiomeBase(registry, i.getVanillaDerivative())); @@ -124,7 +124,7 @@ public class CustomBiomeSource extends BiomeSource { for (IrisBiome i : engine.getAllBiomes()) { if (i.isCustom()) { for (IrisBiomeCustom j : i.getCustomDerivitives()) { - ResourceLocation resourceLocation = ResourceLocation.fromNamespaceAndPath(engine.getDimension().getLoadKey(), j.getId()); + ResourceLocation resourceLocation = ResourceLocation.fromNamespaceAndPath(engine.getDimension().getLoadKey().toLowerCase(java.util.Locale.ROOT), j.getId().toLowerCase(java.util.Locale.ROOT)); Biome biome = customRegistry.getValue(resourceLocation); Optional> optionalBiomeKey = customRegistry.getResourceKey(biome); if (optionalBiomeKey.isEmpty()) { diff --git a/nms/v1_21_R3/src/main/java/art/arcane/iris/core/nms/v1_21_R3/CustomBiomeSource.java b/nms/v1_21_R3/src/main/java/art/arcane/iris/core/nms/v1_21_R3/CustomBiomeSource.java index 312e25767..8ef5fd362 100644 --- a/nms/v1_21_R3/src/main/java/art/arcane/iris/core/nms/v1_21_R3/CustomBiomeSource.java +++ b/nms/v1_21_R3/src/main/java/art/arcane/iris/core/nms/v1_21_R3/CustomBiomeSource.java @@ -55,7 +55,7 @@ public class CustomBiomeSource extends BiomeSource { if (i.isCustom()) { for (IrisBiomeCustom j : i.getCustomDerivitives()) { b.add(customRegistry.get(customRegistry.getResourceKey(customRegistry - .getValue(ResourceLocation.fromNamespaceAndPath(engine.getDimension().getLoadKey(), j.getId()))).get()).get()); + .getValue(ResourceLocation.fromNamespaceAndPath(engine.getDimension().getLoadKey().toLowerCase(java.util.Locale.ROOT), j.getId().toLowerCase(java.util.Locale.ROOT)))).get()).get()); } } else { b.add(NMSBinding.biomeToBiomeBase(registry, i.getVanillaDerivative())); @@ -125,7 +125,7 @@ public class CustomBiomeSource extends BiomeSource { for (IrisBiome i : engine.getAllBiomes()) { if (i.isCustom()) { for (IrisBiomeCustom j : i.getCustomDerivitives()) { - ResourceLocation resourceLocation = ResourceLocation.fromNamespaceAndPath(engine.getDimension().getLoadKey(), j.getId()); + ResourceLocation resourceLocation = ResourceLocation.fromNamespaceAndPath(engine.getDimension().getLoadKey().toLowerCase(java.util.Locale.ROOT), j.getId().toLowerCase(java.util.Locale.ROOT)); Biome biome = customRegistry.getValue(resourceLocation); Optional> optionalBiomeKey = customRegistry.getResourceKey(biome); if (optionalBiomeKey.isEmpty()) { diff --git a/nms/v1_21_R4/src/main/java/art/arcane/iris/core/nms/v1_21_R4/CustomBiomeSource.java b/nms/v1_21_R4/src/main/java/art/arcane/iris/core/nms/v1_21_R4/CustomBiomeSource.java index e818f0a26..bd0bb9c73 100644 --- a/nms/v1_21_R4/src/main/java/art/arcane/iris/core/nms/v1_21_R4/CustomBiomeSource.java +++ b/nms/v1_21_R4/src/main/java/art/arcane/iris/core/nms/v1_21_R4/CustomBiomeSource.java @@ -55,7 +55,7 @@ public class CustomBiomeSource extends BiomeSource { if (i.isCustom()) { for (IrisBiomeCustom j : i.getCustomDerivitives()) { b.add(customRegistry.get(customRegistry.getResourceKey(customRegistry - .getValue(ResourceLocation.fromNamespaceAndPath(engine.getDimension().getLoadKey(), j.getId()))).get()).get()); + .getValue(ResourceLocation.fromNamespaceAndPath(engine.getDimension().getLoadKey().toLowerCase(java.util.Locale.ROOT), j.getId().toLowerCase(java.util.Locale.ROOT)))).get()).get()); } } else { b.add(NMSBinding.biomeToBiomeBase(registry, i.getVanillaDerivative())); @@ -125,7 +125,7 @@ public class CustomBiomeSource extends BiomeSource { for (IrisBiome i : engine.getAllBiomes()) { if (i.isCustom()) { for (IrisBiomeCustom j : i.getCustomDerivitives()) { - ResourceLocation resourceLocation = ResourceLocation.fromNamespaceAndPath(engine.getDimension().getLoadKey(), j.getId()); + ResourceLocation resourceLocation = ResourceLocation.fromNamespaceAndPath(engine.getDimension().getLoadKey().toLowerCase(java.util.Locale.ROOT), j.getId().toLowerCase(java.util.Locale.ROOT)); Biome biome = customRegistry.getValue(resourceLocation); Optional> optionalBiomeKey = customRegistry.getResourceKey(biome); if (optionalBiomeKey.isEmpty()) { diff --git a/nms/v1_21_R5/src/main/java/art/arcane/iris/core/nms/v1_21_R5/CustomBiomeSource.java b/nms/v1_21_R5/src/main/java/art/arcane/iris/core/nms/v1_21_R5/CustomBiomeSource.java index f27309991..349002148 100644 --- a/nms/v1_21_R5/src/main/java/art/arcane/iris/core/nms/v1_21_R5/CustomBiomeSource.java +++ b/nms/v1_21_R5/src/main/java/art/arcane/iris/core/nms/v1_21_R5/CustomBiomeSource.java @@ -55,7 +55,7 @@ public class CustomBiomeSource extends BiomeSource { if (i.isCustom()) { for (IrisBiomeCustom j : i.getCustomDerivitives()) { b.add(customRegistry.get(customRegistry.getResourceKey(customRegistry - .getValue(ResourceLocation.fromNamespaceAndPath(engine.getDimension().getLoadKey(), j.getId()))).get()).get()); + .getValue(ResourceLocation.fromNamespaceAndPath(engine.getDimension().getLoadKey().toLowerCase(java.util.Locale.ROOT), j.getId().toLowerCase(java.util.Locale.ROOT)))).get()).get()); } } else { b.add(NMSBinding.biomeToBiomeBase(registry, i.getVanillaDerivative())); @@ -125,7 +125,7 @@ public class CustomBiomeSource extends BiomeSource { for (IrisBiome i : engine.getAllBiomes()) { if (i.isCustom()) { for (IrisBiomeCustom j : i.getCustomDerivitives()) { - ResourceLocation resourceLocation = ResourceLocation.fromNamespaceAndPath(engine.getDimension().getLoadKey(), j.getId()); + ResourceLocation resourceLocation = ResourceLocation.fromNamespaceAndPath(engine.getDimension().getLoadKey().toLowerCase(java.util.Locale.ROOT), j.getId().toLowerCase(java.util.Locale.ROOT)); Biome biome = customRegistry.getValue(resourceLocation); Optional> optionalBiomeKey = customRegistry.getResourceKey(biome); if (optionalBiomeKey.isEmpty()) { diff --git a/nms/v1_21_R6/src/main/java/art/arcane/iris/core/nms/v1_21_R6/CustomBiomeSource.java b/nms/v1_21_R6/src/main/java/art/arcane/iris/core/nms/v1_21_R6/CustomBiomeSource.java index 12d75d9c7..f62adf4ef 100644 --- a/nms/v1_21_R6/src/main/java/art/arcane/iris/core/nms/v1_21_R6/CustomBiomeSource.java +++ b/nms/v1_21_R6/src/main/java/art/arcane/iris/core/nms/v1_21_R6/CustomBiomeSource.java @@ -55,7 +55,7 @@ public class CustomBiomeSource extends BiomeSource { if (i.isCustom()) { for (IrisBiomeCustom j : i.getCustomDerivitives()) { b.add(customRegistry.get(customRegistry.getResourceKey(customRegistry - .getValue(ResourceLocation.fromNamespaceAndPath(engine.getDimension().getLoadKey(), j.getId()))).get()).get()); + .getValue(ResourceLocation.fromNamespaceAndPath(engine.getDimension().getLoadKey().toLowerCase(java.util.Locale.ROOT), j.getId().toLowerCase(java.util.Locale.ROOT)))).get()).get()); } } else { b.add(NMSBinding.biomeToBiomeBase(registry, i.getVanillaDerivative())); @@ -125,7 +125,7 @@ public class CustomBiomeSource extends BiomeSource { for (IrisBiome i : engine.getAllBiomes()) { if (i.isCustom()) { for (IrisBiomeCustom j : i.getCustomDerivitives()) { - ResourceLocation resourceLocation = ResourceLocation.fromNamespaceAndPath(engine.getDimension().getLoadKey(), j.getId()); + ResourceLocation resourceLocation = ResourceLocation.fromNamespaceAndPath(engine.getDimension().getLoadKey().toLowerCase(java.util.Locale.ROOT), j.getId().toLowerCase(java.util.Locale.ROOT)); Biome biome = customRegistry.getValue(resourceLocation); Optional> optionalBiomeKey = customRegistry.getResourceKey(biome); if (optionalBiomeKey.isEmpty()) { diff --git a/nms/v1_21_R7/src/main/java/art/arcane/iris/core/nms/v1_21_R7/CustomBiomeSource.java b/nms/v1_21_R7/src/main/java/art/arcane/iris/core/nms/v1_21_R7/CustomBiomeSource.java index 3fb38dec4..c250ad98d 100644 --- a/nms/v1_21_R7/src/main/java/art/arcane/iris/core/nms/v1_21_R7/CustomBiomeSource.java +++ b/nms/v1_21_R7/src/main/java/art/arcane/iris/core/nms/v1_21_R7/CustomBiomeSource.java @@ -55,7 +55,7 @@ public class CustomBiomeSource extends BiomeSource { if (i.isCustom()) { for (IrisBiomeCustom j : i.getCustomDerivitives()) { b.add(customRegistry.get(customRegistry.getResourceKey(customRegistry - .getValue(Identifier.fromNamespaceAndPath(engine.getDimension().getLoadKey(), j.getId()))).get()).get()); + .getValue(Identifier.fromNamespaceAndPath(engine.getDimension().getLoadKey().toLowerCase(java.util.Locale.ROOT), j.getId().toLowerCase(java.util.Locale.ROOT)))).get()).get()); } } else { b.add(NMSBinding.biomeToBiomeBase(registry, i.getVanillaDerivative())); @@ -125,7 +125,7 @@ public class CustomBiomeSource extends BiomeSource { for (IrisBiome i : engine.getAllBiomes()) { if (i.isCustom()) { for (IrisBiomeCustom j : i.getCustomDerivitives()) { - Identifier resourceLocation = Identifier.fromNamespaceAndPath(engine.getDimension().getLoadKey(), j.getId()); + Identifier resourceLocation = Identifier.fromNamespaceAndPath(engine.getDimension().getLoadKey().toLowerCase(java.util.Locale.ROOT), j.getId().toLowerCase(java.util.Locale.ROOT)); Biome biome = customRegistry.getValue(resourceLocation); Optional> optionalBiomeKey = customRegistry.getResourceKey(biome); if (optionalBiomeKey.isEmpty()) {