From 4b169c9ad0edad18e12baf062da78853cf419b22 Mon Sep 17 00:00:00 2001 From: XFactHD Date: Mon, 30 Oct 2023 21:59:31 +0100 Subject: [PATCH 1/2] Fix ObjLoader leaking and using outdated ResourceManager --- .../net/neoforged/neoforge/client/model/obj/ObjLoader.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/net/neoforged/neoforge/client/model/obj/ObjLoader.java b/src/main/java/net/neoforged/neoforge/client/model/obj/ObjLoader.java index ee958b8215..298222a74c 100644 --- a/src/main/java/net/neoforged/neoforge/client/model/obj/ObjLoader.java +++ b/src/main/java/net/neoforged/neoforge/client/model/obj/ObjLoader.java @@ -31,13 +31,12 @@ public class ObjLoader implements IGeometryLoader, ResourceManagerRelo private final Map modelCache = Maps.newConcurrentMap(); private final Map materialCache = Maps.newConcurrentMap(); - private ResourceManager manager = Minecraft.getInstance().getResourceManager(); + private final ResourceManager manager = Minecraft.getInstance().getResourceManager(); @Override public void onResourceManagerReload(ResourceManager resourceManager) { modelCache.clear(); materialCache.clear(); - manager = resourceManager; } @Override From e1f1fff6e183dd7f423b77710aa48db894d75809 Mon Sep 17 00:00:00 2001 From: XFactHD Date: Mon, 30 Oct 2023 22:00:48 +0100 Subject: [PATCH 2/2] Fix OBJ UV calculation to match updated sprite UV getters --- .../net/neoforged/neoforge/client/model/obj/ObjModel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/neoforged/neoforge/client/model/obj/ObjModel.java b/src/main/java/net/neoforged/neoforge/client/model/obj/ObjModel.java index 7fc710add8..b8f6189d07 100644 --- a/src/main/java/net/neoforged/neoforge/client/model/obj/ObjModel.java +++ b/src/main/java/net/neoforged/neoforge/client/model/obj/ObjModel.java @@ -373,8 +373,8 @@ private Pair makeQuad(int[][] indices, int tintIndex, Vect quadBaker.vertex(position.x(), position.y(), position.z()); quadBaker.color(tintedColor.x(), tintedColor.y(), tintedColor.z(), tintedColor.w()); quadBaker.uv( - texture.getU(texCoord.x * 16), - texture.getV((flipV ? 1 - texCoord.y : texCoord.y) * 16)); + texture.getU(texCoord.x), + texture.getV((flipV ? 1 - texCoord.y : texCoord.y))); quadBaker.uv2(uv2); quadBaker.normal(normal.x(), normal.y(), normal.z()); if (i == 0) {