diff --git a/build.gradle b/build.gradle index a8b7532d..39309904 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1684218858 +//version: 1685785062 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -1276,12 +1276,14 @@ tasks.register('faq') { description = 'Prints frequently asked questions about building a project' doLast { - print("If your build fails to fetch dependencies, they might have been deleted and replaced by newer " + - "versions.\nCheck if the versions you try to fetch are still on the distributing sites.\n" + - "The links can be found in repositories.gradle and build.gradle:repositories, " + - "not build.gradle:buildscript.repositories - this one is for gradle plugin metadata.\n\n" + + print("If your build fails to fetch dependencies, run './gradlew updateDependencies'. " + + "Or you can manually check if the versions are still on the distributing sites - " + + "the links can be found in repositories.gradle and build.gradle:repositories, " + + "but not build.gradle:buildscript.repositories - those ones are for gradle plugin metadata.\n\n" + "If your build fails to recognize the syntax of new Java versions, enable Jabel in your " + - "gradle.properties. See how it's done in GTNH ExampleMod/gradle.properties.") + "gradle.properties. See how it's done in GTNH ExampleMod/gradle.properties. " + + "However, keep in mind that Jabel enables only syntax features, but not APIs that were introduced in " + + "Java 9 or later.") } } diff --git a/src/main/java/codechicken/nei/WorldOverlayRenderer.java b/src/main/java/codechicken/nei/WorldOverlayRenderer.java index 969e3c8b..40700eac 100644 --- a/src/main/java/codechicken/nei/WorldOverlayRenderer.java +++ b/src/main/java/codechicken/nei/WorldOverlayRenderer.java @@ -24,10 +24,13 @@ public class WorldOverlayRenderer implements IKeyStateTracker { public static int mobOverlay = 0; private static byte[] mobSpawnCache; private static long mobOverlayUpdateTime; + private static String oregenPatternName; + private static boolean hasOregenPatternBeenSet = false; public static void reset() { mobOverlay = 0; chunkOverlay = 0; + hasOregenPatternBeenSet = false; } @Override @@ -279,15 +282,33 @@ public class WorldOverlayRenderer implements IKeyStateTracker { GL11.glVertex3d(x2, y2, z1 + h); } } else if (chunkOverlay == 3) { - int gx1 = (((entity.chunkCoordX < 0 ? entity.chunkCoordX - 3 : entity.chunkCoordX) / 3 * 3) << 4) - - intOffsetX; - int gz1 = (((entity.chunkCoordZ < 0 ? entity.chunkCoordZ - 3 : entity.chunkCoordZ) / 3 * 3) << 4) - - intOffsetZ; - if (entity.chunkCoordX < 0) { - gx1 += 16; + if (!hasOregenPatternBeenSet) { + try { + oregenPatternName = ((Enum) Class.forName("gregtech.common.GT_Worldgenerator") + .getDeclaredField("oregenPattern").get(null)).name(); + } catch (Exception ignored) { + oregenPatternName = "AXISSYMMETRICAL"; + } + hasOregenPatternBeenSet = true; } - if (entity.chunkCoordZ < 0) { - gz1 += 16; + int gx1; + int gz1; + if (oregenPatternName.equals("EQUAL_SPACING")) { + // gt oregen uses new regular pattern + gx1 = ((Math.floorDiv(entity.chunkCoordX, 3) * 3) << 4) - intOffsetX; + gz1 = ((Math.floorDiv(entity.chunkCoordZ, 3) * 3) << 4) - intOffsetZ; + } else { + // gt oregen uses old bugged pattern + gx1 = (((entity.chunkCoordX < 0 ? entity.chunkCoordX - 3 : entity.chunkCoordX) / 3 * 3) << 4) + - intOffsetX; + gz1 = (((entity.chunkCoordZ < 0 ? entity.chunkCoordZ - 3 : entity.chunkCoordZ) / 3 * 3) << 4) + - intOffsetZ; + if (entity.chunkCoordX < 0) { + gx1 += 16; + } + if (entity.chunkCoordZ < 0) { + gz1 += 16; + } } int gx2 = gx1 + 48; int gz2 = gz1 + 48;