From 9fe5adf64fcebc8fb00a13192d3fb4314f969f08 Mon Sep 17 00:00:00 2001 From: Thalia Nero Date: Sat, 4 Feb 2023 10:17:40 -0600 Subject: [PATCH] Allow bare file names as relative paths. --- gradle.properties | 2 +- .../github/kvverti/colormatic/properties/DefaultColumns.java | 5 ++--- .../kvverti/colormatic/properties/GlobalColorProperties.java | 1 - .../github/kvverti/colormatic/properties/PropertyUtil.java | 4 ++++ src/main/resources/fabric.mod.json | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index ca435e7..09bf4a0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ org.gradle.jvmargs=-Xmx1G yarn_mappings=1.19+build.1 loader_version=0.14.6 # Mod Properties - mod_version = 3.1.2 + mod_version = 3.1.3-snapshot maven_group = io.github.kvverti archives_base_name = colormatic diff --git a/src/main/java/io/github/kvverti/colormatic/properties/DefaultColumns.java b/src/main/java/io/github/kvverti/colormatic/properties/DefaultColumns.java index e437944..aceb0ed 100644 --- a/src/main/java/io/github/kvverti/colormatic/properties/DefaultColumns.java +++ b/src/main/java/io/github/kvverti/colormatic/properties/DefaultColumns.java @@ -26,7 +26,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.checkerframework.checker.units.qual.C; import net.minecraft.util.Identifier; import net.minecraft.util.math.MathHelper; @@ -299,8 +298,8 @@ private static Map createLegacyColu // 1.19 wild biomes // mangrove swamp -> swamp map.put(BiomeKeys.MANGROVE_SWAMP.getValue(), new ColormapProperties.ColumnBounds(6, 1)); - // deep dark -> ocean ¯\_(ツ)_/¯ - map.put(BiomeKeys.DEEP_DARK.getValue(), new ColormapProperties.ColumnBounds(0, 1)); + // deep dark -> lush caves + map.put(BiomeKeys.DEEP_DARK.getValue(), new ColormapProperties.ColumnBounds(175, 1)); return map; } diff --git a/src/main/java/io/github/kvverti/colormatic/properties/GlobalColorProperties.java b/src/main/java/io/github/kvverti/colormatic/properties/GlobalColorProperties.java index f8ae8ac..fb6f659 100644 --- a/src/main/java/io/github/kvverti/colormatic/properties/GlobalColorProperties.java +++ b/src/main/java/io/github/kvverti/colormatic/properties/GlobalColorProperties.java @@ -36,7 +36,6 @@ import net.minecraft.block.MapColor; import net.minecraft.entity.EntityType; import net.minecraft.entity.effect.StatusEffect; -import net.minecraft.resource.Resource; import net.minecraft.resource.ResourceManager; import net.minecraft.text.TextColor; import net.minecraft.util.DyeColor; diff --git a/src/main/java/io/github/kvverti/colormatic/properties/PropertyUtil.java b/src/main/java/io/github/kvverti/colormatic/properties/PropertyUtil.java index 6c47e4e..41c10e0 100644 --- a/src/main/java/io/github/kvverti/colormatic/properties/PropertyUtil.java +++ b/src/main/java/io/github/kvverti/colormatic/properties/PropertyUtil.java @@ -75,6 +75,10 @@ public static String resolve(String path, Identifier id) { } else if(path.startsWith("~/")) { // ~ is the optifine directory path = "optifine" + path.substring(1); + } else if(!path.contains("/") && !path.contains(":")) { + // relative path - not a file path or a namespaced path + String thisPath = id.toString(); + path = thisPath.substring(0, thisPath.lastIndexOf('/') + 1) + path; } return path; } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 557f601..e6fb3e6 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -40,7 +40,7 @@ }, "recommends": { "quilt_loader": "*", - "modmenu": "^3.0.0" + "modmenu": "^4.0.0" }, "suggests": { "flamingo": "*"