From cbc70f7d3ecb9f03c57bcef635cb78e1882990d4 Mon Sep 17 00:00:00 2001 From: UnlikePaladin <36827970+UnlikePaladin@users.noreply.github.com> Date: Sat, 11 Nov 2023 21:39:32 -0600 Subject: [PATCH] Fix a crash on 1.16 servers Really random function was client only for some reason, fixed anyway lol --- .../com/unlikepaladin/pfm/data/materials/VariantBase.java | 2 +- .../com/unlikepaladin/pfm/data/materials/WoodVariant.java | 4 ++-- .../unlikepaladin/pfm/data/materials/WoodVariantRegistry.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/com/unlikepaladin/pfm/data/materials/VariantBase.java b/common/src/main/java/com/unlikepaladin/pfm/data/materials/VariantBase.java index 8fe12461e..041ae8077 100644 --- a/common/src/main/java/com/unlikepaladin/pfm/data/materials/VariantBase.java +++ b/common/src/main/java/com/unlikepaladin/pfm/data/materials/VariantBase.java @@ -80,7 +80,7 @@ protected V findRelatedEntry(String append, String postPend, Registry reg }; V found = null; for (Identifier r : targets) { - if (reg.containsId(r)) { + if (reg.getOrEmpty(r).isPresent()) { found = reg.get(r); break; } diff --git a/common/src/main/java/com/unlikepaladin/pfm/data/materials/WoodVariant.java b/common/src/main/java/com/unlikepaladin/pfm/data/materials/WoodVariant.java index 4bfdc1dd1..6b6af9aa9 100644 --- a/common/src/main/java/com/unlikepaladin/pfm/data/materials/WoodVariant.java +++ b/common/src/main/java/com/unlikepaladin/pfm/data/materials/WoodVariant.java @@ -100,14 +100,14 @@ protected Block findLogRelatedBlock(String append, String postpend) { new Identifier(id.getNamespace(), append + "_" + id.getPath() + postNether.replace("_", "")) }; for (Identifier r : nether_targets) { - if (Registry.BLOCK.containsId(r)) { + if (Registry.BLOCK.getOrEmpty(r).isPresent()) { found = Registry.BLOCK.get(r); break; } } } for (Identifier r : targets) { - if (Registry.BLOCK.containsId(r)) { + if (Registry.BLOCK.getOrEmpty(r).isPresent()) { found = Registry.BLOCK.get(r); break; } diff --git a/common/src/main/java/com/unlikepaladin/pfm/data/materials/WoodVariantRegistry.java b/common/src/main/java/com/unlikepaladin/pfm/data/materials/WoodVariantRegistry.java index ebcad2be4..074a4a6bf 100644 --- a/common/src/main/java/com/unlikepaladin/pfm/data/materials/WoodVariantRegistry.java +++ b/common/src/main/java/com/unlikepaladin/pfm/data/materials/WoodVariantRegistry.java @@ -112,7 +112,7 @@ private static Block findLog(Identifier id) { }; Block temp = null; for (Identifier r : test) { - if (Registry.BLOCK.containsId(r)) { + if (Registry.BLOCK.getOrEmpty(r).isPresent()) { temp = Registry.BLOCK.get(r); break; }