diff --git a/changelog.md b/changelog.md index 82f3547aa..b4658bbf8 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,8 @@ ------------------------------------------------------ +Version 1.6.1 +------------------------------------------------------ +- Fix crash from fabric class on forge +------------------------------------------------------ Version 1.6.0 ------------------------------------------------------ Additions diff --git a/common/src/main/java/com/railwayteam/railways/content/palettes/boiler/BoilerBigOutlines.java b/common/src/main/java/com/railwayteam/railways/content/palettes/boiler/BoilerBigOutlines.java index 9d9f9f7cd..39485643c 100644 --- a/common/src/main/java/com/railwayteam/railways/content/palettes/boiler/BoilerBigOutlines.java +++ b/common/src/main/java/com/railwayteam/railways/content/palettes/boiler/BoilerBigOutlines.java @@ -3,10 +3,11 @@ import com.simibubi.create.foundation.utility.AnimationTickHolder; import com.simibubi.create.foundation.utility.RaycastHelper; import com.simibubi.create.foundation.utility.VecHelper; -import com.simibubi.create.foundation.utility.fabric.ReachUtil; +import dev.architectury.injectables.annotations.ExpectPlatform; import net.minecraft.client.Minecraft; import net.minecraft.client.player.LocalPlayer; import net.minecraft.core.BlockPos; +import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.Vec3; @@ -31,7 +32,7 @@ public static void pick() { : mc.hitResult.getLocation() .distanceToSqr(origin); - double range = ReachUtil.reach(player); + double range = getRange(player); Vec3 target = RaycastHelper.getTraceTarget(player, Math.min(maxRange, range) + 1, origin); RaycastHelper.rayTraceUntil(origin, target, pos -> { @@ -79,4 +80,9 @@ public static void pick() { if (result != null) mc.hitResult = result; } + + @ExpectPlatform + public static double getRange(Player player) { + throw new AssertionError(); + } } diff --git a/fabric/src/main/java/com/railwayteam/railways/content/palettes/boiler/fabric/BoilerBigOutlinesImpl.java b/fabric/src/main/java/com/railwayteam/railways/content/palettes/boiler/fabric/BoilerBigOutlinesImpl.java new file mode 100644 index 000000000..6b4c6c578 --- /dev/null +++ b/fabric/src/main/java/com/railwayteam/railways/content/palettes/boiler/fabric/BoilerBigOutlinesImpl.java @@ -0,0 +1,10 @@ +package com.railwayteam.railways.content.palettes.boiler.fabric; + +import com.simibubi.create.foundation.utility.fabric.ReachUtil; +import net.minecraft.world.entity.player.Player; + +public class BoilerBigOutlinesImpl { + public static double getRange(Player player) { + return ReachUtil.reach(player); + } +} diff --git a/forge/src/main/java/com/railwayteam/railways/content/palettes/boiler/forge/BoilerBigOutlinesImpl.java b/forge/src/main/java/com/railwayteam/railways/content/palettes/boiler/forge/BoilerBigOutlinesImpl.java new file mode 100644 index 000000000..02ef38f9b --- /dev/null +++ b/forge/src/main/java/com/railwayteam/railways/content/palettes/boiler/forge/BoilerBigOutlinesImpl.java @@ -0,0 +1,10 @@ +package com.railwayteam.railways.content.palettes.boiler.forge; + +import net.minecraft.world.entity.player.Player; +import net.minecraftforge.common.ForgeMod; + +public class BoilerBigOutlinesImpl { + public static double getRange(Player player) { + return player.getAttribute(ForgeMod.REACH_DISTANCE.get()).getValue(); + } +} diff --git a/gradle.properties b/gradle.properties index 7e18646aa..5ea0c63be 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ org.gradle.jvmargs = -Xmx3G # Mod Info archives_base_name = Steam_Rails -mod_version = 1.6.0 +mod_version = 1.6.1 maven_group = com.railwayteam.railways minecraft_version = 1.20.1