From e0e419f3fe92ea0aea8f14a423fd7936097c03b7 Mon Sep 17 00:00:00 2001 From: thedarkcolour <30441001+thedarkcolour@users.noreply.github.com> Date: Thu, 21 Mar 2024 22:10:46 -0700 Subject: [PATCH] Track transparent crucibles --- .../java/thedarkcolour/exdeorum/event/EventHandler.java | 2 ++ .../exdeorum/material/AbstractCrucibleMaterial.java | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/src/main/java/thedarkcolour/exdeorum/event/EventHandler.java b/src/main/java/thedarkcolour/exdeorum/event/EventHandler.java index 85479d57..0a7fed77 100644 --- a/src/main/java/thedarkcolour/exdeorum/event/EventHandler.java +++ b/src/main/java/thedarkcolour/exdeorum/event/EventHandler.java @@ -66,6 +66,7 @@ import thedarkcolour.exdeorum.compat.ModIds; import thedarkcolour.exdeorum.compat.top.ExDeorumTopCompat; import thedarkcolour.exdeorum.config.EConfig; import thedarkcolour.exdeorum.item.WateringCanItem; +import thedarkcolour.exdeorum.material.AbstractCrucibleMaterial; import thedarkcolour.exdeorum.material.BarrelMaterial; import thedarkcolour.exdeorum.network.NetworkHandler; import thedarkcolour.exdeorum.network.VisualUpdateTracker; @@ -183,6 +184,7 @@ public final class EventHandler { )); BarrelMaterial.loadTransparentBlocks(); + AbstractCrucibleMaterial.loadTransparentBlocks(); }); } diff --git a/src/main/java/thedarkcolour/exdeorum/material/AbstractCrucibleMaterial.java b/src/main/java/thedarkcolour/exdeorum/material/AbstractCrucibleMaterial.java index 3d5ffd5d..0d7c1c37 100644 --- a/src/main/java/thedarkcolour/exdeorum/material/AbstractCrucibleMaterial.java +++ b/src/main/java/thedarkcolour/exdeorum/material/AbstractCrucibleMaterial.java @@ -18,6 +18,8 @@ package thedarkcolour.exdeorum.material; +import com.google.common.collect.Iterables; +import com.google.common.collect.Iterators; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.SoundType; import org.jetbrains.annotations.Nullable; @@ -53,6 +55,12 @@ public abstract class AbstractCrucibleMaterial extends AbstractMaterial { } } + public static void loadTransparentBlocks() { + for (var material : Iterables.concat(DefaultMaterials.WATER_CRUCIBLES, DefaultMaterials.LAVA_CRUCIBLES)) { + TRANSPARENT_CRUCIBLES.add(material.getBlock()); + } + } + public interface Factory { T create(SoundType soundType, float strength, boolean needsCorrectTool, int mapColor, String requiredModId, boolean transparent); }