diff --git a/src/main/java/exnihiloadscensio/barrel/modes/fluid/BarrelModeFluid.java b/src/main/java/exnihiloadscensio/barrel/modes/fluid/BarrelModeFluid.java index ec0001b6..7aa644df 100644 --- a/src/main/java/exnihiloadscensio/barrel/modes/fluid/BarrelModeFluid.java +++ b/src/main/java/exnihiloadscensio/barrel/modes/fluid/BarrelModeFluid.java @@ -174,7 +174,6 @@ public void update(TileBarrel barrel) { List transformers = FluidTransformRegistry .getFluidTransformers(barrel.getTank().getFluid().getFluid().getName()); - boolean found = false; for (int radius = 0; radius <= 2; radius++) { for (FluidTransformer transformer : transformers) { if (!BarrelLiquidBlacklistRegistry.isBlacklisted(barrel.getTier(), transformer.getOutputFluid()) @@ -194,10 +193,9 @@ public void update(TileBarrel barrel) { mode.setOutputStack(FluidRegistry.getFluidStack(transformer.getOutputFluid(), 1000)); PacketHandler.sendNBTUpdate(barrel); - found = true; + return; } } - if (found) break; } } } diff --git a/src/main/java/exnihiloadscensio/barrel/modes/transform/BarrelModeFluidTransform.java b/src/main/java/exnihiloadscensio/barrel/modes/transform/BarrelModeFluidTransform.java index 428346cc..72281f85 100644 --- a/src/main/java/exnihiloadscensio/barrel/modes/transform/BarrelModeFluidTransform.java +++ b/src/main/java/exnihiloadscensio/barrel/modes/transform/BarrelModeFluidTransform.java @@ -112,7 +112,7 @@ public float getFilledLevelForRender(TileBarrel barrel) { @Override public void update(TileBarrel barrel) { - if (transformer == null) { + if (transformer == null && inputStack != null && outputStack != null) { transformer = FluidTransformRegistry.getFluidTransformer(inputStack .getFluid().getName(), outputStack.getFluid().getName()); } diff --git a/src/main/java/exnihiloadscensio/util/Util.java b/src/main/java/exnihiloadscensio/util/Util.java index 7a08c46d..0d07a374 100644 --- a/src/main/java/exnihiloadscensio/util/Util.java +++ b/src/main/java/exnihiloadscensio/util/Util.java @@ -87,7 +87,7 @@ public static TextureAtlasSprite getTextureFromBlockState(IBlockState state) { public static TextureAtlasSprite getTextureFromFluidStack(FluidStack stack) { - if(stack.getFluid() != null) + if(stack != null && stack.getFluid() != null) { Fluid fluid = stack.getFluid();