Skip to content

Commit

Permalink
Merge branch 'refs/heads/1.19/dev' into 1.20/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Apr 8, 2024
2 parents cade336 + aadb551 commit b1eca02
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
------------------------------------------------------
Version 1.6.1
------------------------------------------------------
- Fix crash from fabric class on forge
------------------------------------------------------
Version 1.6.0
------------------------------------------------------
Additions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 -> {
Expand Down Expand Up @@ -79,4 +80,9 @@ public static void pick() {
if (result != null)
mc.hitResult = result;
}

@ExpectPlatform
public static double getRange(Player player) {
throw new AssertionError();
}
}
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
@@ -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();
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b1eca02

Please sign in to comment.