diff --git a/.gitignore b/.gitignore index 00650de1f..c9fe5dcdd 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ build.number libs/ run/ .idea/ +.vscode/ diff --git a/README.md b/README.md index 0232b8956..6b538bd96 100644 --- a/README.md +++ b/README.md @@ -9,5 +9,5 @@ Compiling ========= * Clone the repository * Open a command prompt/terminal to the repository directory -* run 'gradlew build' +* run 'gradlew build' (or try '.\gradlew build' if this fails with Powershell) * The built jar file will be in build/libs/ diff --git a/gradle.properties b/gradle.properties index d0b6a4094..574d9f77e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,7 +12,7 @@ mod_file_name = minihud-fabric mod_version = 0.34.0-sakura.3 # Required malilib version -malilib_version = 975d68adf7 +malilib_version = b41a9d0fa3 # Minecraft, Fabric Loader and API and mappings versions minecraft_version_out = 1.21.4 diff --git a/src/main/java/fi/dy/masa/minihud/renderer/shapes/ShapeCircle.java b/src/main/java/fi/dy/masa/minihud/renderer/shapes/ShapeCircle.java index 2026f8903..8edc871eb 100644 --- a/src/main/java/fi/dy/masa/minihud/renderer/shapes/ShapeCircle.java +++ b/src/main/java/fi/dy/masa/minihud/renderer/shapes/ShapeCircle.java @@ -137,18 +137,12 @@ protected boolean isPositionOnOrInsideRing(int blockX, int blockY, int blockZ, D double distSq = effectiveCenter.squaredDistanceTo(x, y, z); double diff = radiusSq - distSq; - if (diff > 0) + if (diff >= 0) { return true; } - double xAdj = x + outSide.getOffsetX(); - double yAdj = y + outSide.getOffsetY(); - double zAdj = z + outSide.getOffsetZ(); - double distAdjSq = effectiveCenter.squaredDistanceTo(xAdj, yAdj, zAdj); - double diffAdj = radiusSq - distAdjSq; - - return diffAdj > 0 && Math.abs(diff) < Math.abs(diffAdj); + return false; } public static List buildStripsToQuadsForCircle(Long2ObjectOpenHashMap strips, diff --git a/src/main/java/fi/dy/masa/minihud/util/shape/SphereUtils.java b/src/main/java/fi/dy/masa/minihud/util/shape/SphereUtils.java index adbd5c7a1..c218d752c 100644 --- a/src/main/java/fi/dy/masa/minihud/util/shape/SphereUtils.java +++ b/src/main/java/fi/dy/masa/minihud/util/shape/SphereUtils.java @@ -191,18 +191,12 @@ public static boolean isPositionInsideOrClosestToRadiusOnBlockRing(int blockX, double dist = center.squaredDistanceTo(x, y, z); double diff = squareRadius - dist; - if (diff > 0) + if (diff >= 0) { return true; } - - double xAdj = (double) blockX + escapeDirection.getOffsetX() + 0.5; - double yAdj = (double) blockY + escapeDirection.getOffsetY() + 0.5; - double zAdj = (double) blockZ + escapeDirection.getOffsetZ() + 0.5; - double distAdj = center.squaredDistanceTo(xAdj, yAdj, zAdj); - double diffAdj = squareRadius - distAdj; - - return diffAdj > 0 && Math.abs(diff) < Math.abs(diffAdj); + + return false; } /** diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 1f7e158b2..dc6153a05 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -35,6 +35,6 @@ "depends": { "minecraft": "1.21.4", - "malilib": ">=0.23.0-sakura.3" + "malilib": ">=0.23.0-sakura.4" } }