From 363519db029b8fcc63103eb73a5d68dc6b0d09f9 Mon Sep 17 00:00:00 2001 From: ZacSharp <68165024+ZacSharp@users.noreply.github.com> Date: Tue, 9 Mar 2021 11:53:43 +0100 Subject: [PATCH] treat all airs as air --- .../java/baritone/api/schematic/SubstituteSchematic.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/api/java/baritone/api/schematic/SubstituteSchematic.java b/src/api/java/baritone/api/schematic/SubstituteSchematic.java index c1cb5a18..439ba244 100644 --- a/src/api/java/baritone/api/schematic/SubstituteSchematic.java +++ b/src/api/java/baritone/api/schematic/SubstituteSchematic.java @@ -18,6 +18,7 @@ package baritone.api.schematic; import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; import net.minecraft.block.properties.IProperty; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; @@ -49,12 +50,12 @@ public class SubstituteSchematic extends AbstractSchematic { return desired; } List substitutes = substitutions.get(desiredBlock); - if (substitutes.contains(current.getBlock()) && !current.getBlock().equals(Blocks.AIR)) {// don't preserve air, it's almost always there and almost never wanted + if (substitutes.contains(current.getBlock()) && !(current.getBlock() instanceof BlockAir)) {// don't preserve air, it's almost always there and almost never wanted return withBlock(desired, current.getBlock()); } for (Block substitute : substitutes) { - if (substitute.equals(Blocks.AIR)) { - return Blocks.AIR.getDefaultState(); // can always "place" air + if (substitute instanceof BlockAir) { + return current.getBlock() instanceof BlockAir ? current : Blocks.AIR.getDefaultState(); // can always "place" air } for (IBlockState placeable : approxPlaceable) { if (substitute.equals(placeable.getBlock())) {