From c1462b132f233650e3d172b79e0396b772129158 Mon Sep 17 00:00:00 2001 From: trinsdar <30245301+Trinsdar@users.noreply.github.com> Date: Fri, 8 Sep 2023 01:54:16 -0400 Subject: [PATCH] fixed class cast exception --- .../muramasa/antimatter/mixin/forge/TileEntityPipeMixin.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/forge/src/main/java/muramasa/antimatter/mixin/forge/TileEntityPipeMixin.java b/forge/src/main/java/muramasa/antimatter/mixin/forge/TileEntityPipeMixin.java index 35f6fe564..987d8e4f5 100644 --- a/forge/src/main/java/muramasa/antimatter/mixin/forge/TileEntityPipeMixin.java +++ b/forge/src/main/java/muramasa/antimatter/mixin/forge/TileEntityPipeMixin.java @@ -74,11 +74,13 @@ public LazyOptional getCapability(@NotNull Capability cap, @Nullable D if (pipeCaps[side.get3DDataValue()] == null || !pipeCaps[side.get3DDataValue()].isPresent()){ pipeCaps[side.get3DDataValue()] = fromEnergyHolder(pipeCapHolder, side).cast(); } + return pipeCaps[side.get3DDataValue()].cast(); } if (cap == ITEM_HANDLER_CAPABILITY && getCapClass() == ExtendedItemContainer.class){ if (pipeCaps[side.get3DDataValue()] == null || !pipeCaps[side.get3DDataValue()].isPresent()){ pipeCaps[side.get3DDataValue()] = fromItemHolder(pipeCapHolder, side).cast(); } + return pipeCaps[side.get3DDataValue()].cast(); } try { if (cap == AntimatterCaps.CAP_MAP.get(getCapClass())){ @@ -90,7 +92,7 @@ public LazyOptional getCapability(@NotNull Capability cap, @Nullable D e.printStackTrace(); return LazyOptional.empty(); } - if (pipeCaps[side.get3DDataValue()] != null){ + if (pipeCaps[side.get3DDataValue()] != null && cap == AntimatterCaps.CAP_MAP.get(getCapClass())){ return pipeCaps[side.get3DDataValue()].cast(); } return LazyOptional.empty();