From 3e5f657092b1a0213539ab1285ff22f1468723b3 Mon Sep 17 00:00:00 2001 From: Jottyfan Date: Fri, 19 Jan 2024 23:50:45 +0100 Subject: [PATCH] removed dependency to terrestria which caused a crash on missing the mod --- build.gradle | 12 ------------ gradle.properties | 5 +---- .../quickiefabric/tools/ToolRangeableAxe.java | 11 +++++++++-- .../worldgen/placed_feature/orenethersulphor.json | 2 +- 4 files changed, 11 insertions(+), 19 deletions(-) diff --git a/build.gradle b/build.gradle index ad0f326..d5078a9 100644 --- a/build.gradle +++ b/build.gradle @@ -32,18 +32,6 @@ dependencies { // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs. // You may need to force-disable transitiveness on them. - - // for special leaves blocks like ExtendedLeavesBlock - modImplementation "com.terraformersmc.terraform-api:terraform-wood-api-v1:${project.terraform_wood_api_version}" - repositories { - maven { - name = 'TerraformersMC' - url = 'https://maven.terraformersmc.com/' - } - maven { - url = 'https://maven.minecraftforge.net/' - } - } } processResources { diff --git a/gradle.properties b/gradle.properties index d4c7fcd..622c0bc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,12 +9,9 @@ loader_version=0.15.1 # Mod Properties - mod_version = 1.20.4.7 + mod_version = 1.20.4.8 maven_group = de.jottyfan.minecraft archives_base_name = quickiefabric # Dependencies fabric_version=0.91.2+1.20.4 - -# for ExtendedLeavesBlock - terraform_wood_api_version=9.0.0-alpha.3 diff --git a/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/ToolRangeableAxe.java b/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/ToolRangeableAxe.java index 02051ca..9488c54 100644 --- a/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/ToolRangeableAxe.java +++ b/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/ToolRangeableAxe.java @@ -3,7 +3,6 @@ package de.jottyfan.minecraft.quickiefabric.tools; import java.util.List; import com.google.common.collect.Lists; -import com.terraformersmc.terraform.leaves.block.ExtendedLeavesBlock; import net.minecraft.block.Block; import net.minecraft.block.BlockState; @@ -43,7 +42,15 @@ public class ToolRangeableAxe extends AxeItem implements ToolRangeable { */ private boolean isLeavesBlock(BlockState blockIn) { boolean vanillaLeaves = blockIn.getBlock() instanceof LeavesBlock; - boolean terrestriaLeaves = blockIn.getBlock() instanceof ExtendedLeavesBlock; + boolean terrestriaLeaves = false; + try { + Class extendedLeavesBlock = Class.forName("com.terraformersmc.terraform.leaves.block.ExtendedLeavesBlock"); + terrestriaLeaves = extendedLeavesBlock.isInstance(blockIn.getBlock()); + } catch (ClassNotFoundException e) { + // no terrestria mod available, so ignore this + // using this approach instead of the instanceof functionality, we don't need to refer to terrestria + // and omit a crash on installations that do not have or want terrestria available + } boolean blockTagLeaves = blockIn.isIn(BlockTags.LEAVES); return vanillaLeaves || terrestriaLeaves || blockTagLeaves; } diff --git a/src/main/resources/data/quickiefabric/worldgen/placed_feature/orenethersulphor.json b/src/main/resources/data/quickiefabric/worldgen/placed_feature/orenethersulphor.json index 03b7067..6c0dfc1 100644 --- a/src/main/resources/data/quickiefabric/worldgen/placed_feature/orenethersulphor.json +++ b/src/main/resources/data/quickiefabric/worldgen/placed_feature/orenethersulphor.json @@ -3,7 +3,7 @@ "placement": [ { "type": "minecraft:count", - "count": 25 + "count": 12 }, { "type": "minecraft:in_square"