Skip to content

Commit

Permalink
Allow bare file names as relative paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
kvverti committed Feb 4, 2023
1 parent d144199 commit 9fe5adf
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -299,8 +298,8 @@ private static Map<Identifier, ColormapProperties.ColumnBounds> 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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
},
"recommends": {
"quilt_loader": "*",
"modmenu": "^3.0.0"
"modmenu": "^4.0.0"
},
"suggests": {
"flamingo": "*"
Expand Down

0 comments on commit 9fe5adf

Please sign in to comment.