Skip to content

Commit

Permalink
quilt loader fix (closes #30)
Browse files Browse the repository at this point in the history
  • Loading branch information
isXander committed Jul 10, 2022
1 parent 1b7db76 commit 74530ea
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 18 deletions.
13 changes: 3 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,14 @@ plugins {
}

group = "dev.isxander"
version = "1.0.3"
version = "1.0.4"

repositories {
mavenCentral()
maven("https://jitpack.io")
maven("https://maven.shedaniel.me")
maven("https://maven.terraformersmc.com")
maven("https://maven.flashyreese.me/snapshots")
maven("https://api.modrinth.com/maven") {
content {
includeGroup("maven.modrinth")
}
}
}

val minecraftVersion: String by project
Expand Down Expand Up @@ -169,8 +164,8 @@ githubRelease {
publishing {
publications {
create<MavenPublication>("mod") {
groupId = "dev.isxander"
artifactId = "cull-less-leaves"
groupId = group.toString()
artifactId = base.archivesName.get()

from(components["java"])
}
Expand All @@ -184,8 +179,6 @@ publishing {
password = property("xander-repo.password")?.toString()
}
}
} else {
println("Xander Repo not available!")
}
}
}
1 change: 1 addition & 0 deletions changelogs/1.0.4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix crash on Quilt Loader
10 changes: 4 additions & 6 deletions src/main/java/dev/isxander/culllessleaves/CullLessLeaves.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import me.shedaniel.autoconfig.serializer.Toml4jConfigSerializer;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.api.Version;
import net.fabricmc.loader.api.VersionParsingException;
import net.fabricmc.loader.api.entrypoint.PreLaunchEntrypoint;
import net.fabricmc.loader.impl.FormattedException;
import net.fabricmc.loader.impl.util.version.VersionPredicateParser;
import net.fabricmc.loader.api.metadata.version.VersionComparisonOperator;
import net.minecraft.block.LeavesBlock;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
Expand All @@ -21,14 +21,12 @@ public class CullLessLeaves implements ClientModInitializer, PreLaunchEntrypoint
public void onInitializeClient() {
FabricLoader.getInstance().getModContainer("moreculling").ifPresent((mod) -> {
try {
var predicate = VersionPredicateParser.parse(">=0.5.0");
if (!predicate.test(mod.getMetadata().getVersion())) {
throw new FormattedException("Incompatible mod set!", "moreculling is present but does not match " + predicate);
if (!VersionComparisonOperator.GREATER_EQUAL.test(mod.getMetadata().getVersion(), Version.parse("0.5.0"))) {
throw new RuntimeException("MoreCulling compatibility requires version >=0.5.0");
}
} catch (VersionParsingException e) {
e.printStackTrace();
}

});

AutoConfig.register(CullLessLeavesConfig.class, Toml4jConfigSerializer::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import net.minecraft.client.MinecraftClient;

public class SodiumCompat {
private static final OptionStorage<CullLessLeavesConfig> OPTION_STORAGE = new OptionStorage<CullLessLeavesConfig>() {
private static final OptionStorage<CullLessLeavesConfig> OPTION_STORAGE = new OptionStorage<>() {
@Override
public CullLessLeavesConfig getData() {
return CullLessLeaves.getConfig();
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"depends": {
"fabricloader": ">=0.14.0",
"minecraft": "1.19.x",
"java": ">=17"
"java": ">=17",
"cloth-config": "7.x.x"
},
"suggests": {
"sodium": "*"
Expand Down

0 comments on commit 74530ea

Please sign in to comment.