Skip to content

Commit

Permalink
add setting for beacon min scale
Browse files Browse the repository at this point in the history
  • Loading branch information
rfresh2 committed Jul 4, 2023
1 parent ab1b942 commit 3765e39
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ public void renderWaypointBeacon(final Waypoint waypoint, float tickDelta, Matri
Vec3d playerVec = mc.player.getPos();
Vec3d waypointVec = new Vec3d(waypoint.getX(), waypoint.getY(), waypoint.getZ());
double actualDistance = playerVec.distanceTo(waypointVec);
double maxRenderDistance = Math.min(mc.options.getViewDistance().getValue() << 4, 512);
final int farScale = (int) XaeroPlusSettingRegistry.waypointBeaconScaleMin.getValue();
double maxRenderDistance = Math.min(mc.options.getViewDistance().getValue() << 4, farScale == 0 ? Integer.MAX_VALUE : farScale << 4);
if (actualDistance > maxRenderDistance) {
final Vec3d delta = waypointVec.subtract(playerVec).normalize();
waypointVec = playerVec.add(new Vec3d(delta.x * maxRenderDistance, delta.y * maxRenderDistance, delta.z * maxRenderDistance));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,10 @@ public enum DataFolderResolutionMode {
public static final XaeroPlusBooleanSetting waypointBeacons = XaeroPlusBooleanSetting.create("Waypoint Beacons",
"Render waypoint beacons in game.",
true, SettingLocation.WAYPOINTS);
public static final XaeroPlusFloatSetting waypointBeaconScaleMin = XaeroPlusFloatSetting.create("Waypoint Beacon Scale Min",
0f, 30f, 1f,
"Sets the minimum scale of the waypoint beacon when it is far away."
+ " \\n This value is the number of chunks away from the player the beacon is rendered at."
+ " \\n 0 = auto-match the player's render distance",
0f, SettingLocation.WAYPOINTS);
}

0 comments on commit 3765e39

Please sign in to comment.