From 6e818ecb705d75170f18ce80a4f615626905dd77 Mon Sep 17 00:00:00 2001 From: PouffyDev <99536749+pouffy@users.noreply.github.com> Date: Wed, 9 Jul 2025 20:34:34 +0100 Subject: [PATCH] Bug Fixes - Distillation Controller now checks if the tank controller is present before using it (Cannot invoke "SteelTankBlockEntity.getHeight()" because the return value of "SteelTankBlockEntity.getControllerBE()" is null) - Blast Furnace Output now ensures the tuyerePos is not null before using it to get the tuyere block entity (Cannot invoke "BlockPos.m_123342_()" because "p_151571_" is null) - Reran datagen for Sulfuric Acid's blockstate to fix empty file. --- .../resources/assets/tfmg/blockstates/sulfuric_acid.json | 7 +++++++ .../blast_furnace/BlastFurnaceOutputBlockEntity.java | 2 +- .../controller/DistillationControllerBlockEntity.java | 7 +++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/generated/resources/assets/tfmg/blockstates/sulfuric_acid.json b/src/generated/resources/assets/tfmg/blockstates/sulfuric_acid.json index e69de29b..4955ed34 100644 --- a/src/generated/resources/assets/tfmg/blockstates/sulfuric_acid.json +++ b/src/generated/resources/assets/tfmg/blockstates/sulfuric_acid.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "tfmg:block/sulfuric_acid" + } + } +} \ No newline at end of file diff --git a/src/main/java/com/drmangotea/tfmg/content/machinery/metallurgy/blast_furnace/BlastFurnaceOutputBlockEntity.java b/src/main/java/com/drmangotea/tfmg/content/machinery/metallurgy/blast_furnace/BlastFurnaceOutputBlockEntity.java index 9c77eeac..f4a58101 100644 --- a/src/main/java/com/drmangotea/tfmg/content/machinery/metallurgy/blast_furnace/BlastFurnaceOutputBlockEntity.java +++ b/src/main/java/com/drmangotea/tfmg/content/machinery/metallurgy/blast_furnace/BlastFurnaceOutputBlockEntity.java @@ -310,7 +310,7 @@ public class BlastFurnaceOutputBlockEntity extends SmartBlockEntity implements I tuyereBE = null; return; } - if (tuyereBE == null) + if (tuyereBE == null && tuyerePos != null) tuyereBE = (BlastFurnaceHatchBlockEntity) level.getBlockEntity(tuyerePos); if (tuyereBE.tank.getFluidAmount() < recipe.hotAirUsage || !tuyereBE.tank.getFluid().getFluid().isSame(TFMGFluids.HOT_AIR.getSource())) diff --git a/src/main/java/com/drmangotea/tfmg/content/machinery/oil_processing/distillation_tower/controller/DistillationControllerBlockEntity.java b/src/main/java/com/drmangotea/tfmg/content/machinery/oil_processing/distillation_tower/controller/DistillationControllerBlockEntity.java index f2e76556..0acc3d9b 100644 --- a/src/main/java/com/drmangotea/tfmg/content/machinery/oil_processing/distillation_tower/controller/DistillationControllerBlockEntity.java +++ b/src/main/java/com/drmangotea/tfmg/content/machinery/oil_processing/distillation_tower/controller/DistillationControllerBlockEntity.java @@ -95,8 +95,11 @@ public class DistillationControllerBlockEntity extends SmartBlockEntity implemen if (be.isController()) { if (be.getHeight() < outputs.toArray().length * 2 || (be.width < 2 && outputs.toArray().length > 3)) return; - } else if (be.getControllerBE().getHeight() < outputs.toArray().length * 2 || be.getControllerBE().width < 2) - return; + } else { + if (be.getControllerBE() != null) + if (be.getControllerBE().getHeight() < outputs.toArray().length * 2 || be.getControllerBE().width < 2) + return; + } for (DistillationOutputBlockEntity be1 : outputs) { if (be1.tank.getSpace() == 0&&be1.mode.get() == DistillationOutputBlockEntity.DistillationOutputMode.KEEP_FLUID)