From afd082e0fe8f2cb340ee728f15ca5517505179f9 Mon Sep 17 00:00:00 2001 From: UnlikePaladin <36827970+UnlikePaladin@users.noreply.github.com> Date: Thu, 28 Dec 2023 01:04:57 -0600 Subject: [PATCH] fix pixelmon's missing textures hopefully --- .../pfm/blocks/models/ModelHelper.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/common/src/main/java/com/unlikepaladin/pfm/blocks/models/ModelHelper.java b/common/src/main/java/com/unlikepaladin/pfm/blocks/models/ModelHelper.java index c2823c202..905008e1f 100644 --- a/common/src/main/java/com/unlikepaladin/pfm/blocks/models/ModelHelper.java +++ b/common/src/main/java/com/unlikepaladin/pfm/blocks/models/ModelHelper.java @@ -192,6 +192,11 @@ public static Identifier getTextureId(Block block, String postfix) { blockToTextureMap.put(pair, new Pair<>(id, attemptNum)); return id; } + id = model.getQuads(block.getDefaultState(), Direction.DOWN, new Random(42L)).get(0).getSprite().getId(); + if (id != null) { + blockToTextureMap.put(pair, new Pair<>(id, attemptNum)); + return id; + } } } @@ -259,6 +264,10 @@ public static Identifier getPlankId(Block block) { return id; path = "planks_" + path; + if (namespace.contains("pixelmon") && path.contains("ultra")) { + path = path.replace("ultra_", "").replace("_ultra", ""); + path = "ultra_space/" + path; + } id = new Identifier(namespace, "block/" + path); path = path.replace("mining", "mine").replace("sorting", "sort").replace("transformation", "trans").replace("dark", "darkwood").replace("alpha_", "alpha_oak_").replace("flowering_pink", "flowerypink").replace("flowering_purple", "floweringpurple"); Identifier id2 = new Identifier(namespace, "block/wood/" + path); @@ -299,6 +308,10 @@ public static Identifier getLogId(Block block, String postFix) { if (namespace.contains("luphieclutteredmod") && path.contains("flowering_log")) { path = path.replace("flowering_log", "flowering_yellow_log"); } + if (namespace.contains("pixelmon") && path.contains("ultra")) { + path = path.replace("ultra_", "").replace("_ultra", ""); + path = "ultra_space/" + path; + } if (namespace.equals("byg") && path.contains("pedu")) path = path.replace("pedu", "log"); if (path.contains("log") || path.contains("stem")) {