treat all airs as air
This commit is contained in:
parent
113d26937d
commit
363519db02
@ -18,6 +18,7 @@
|
|||||||
package baritone.api.schematic;
|
package baritone.api.schematic;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.BlockAir;
|
||||||
import net.minecraft.block.properties.IProperty;
|
import net.minecraft.block.properties.IProperty;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
@ -49,12 +50,12 @@ public class SubstituteSchematic extends AbstractSchematic {
|
|||||||
return desired;
|
return desired;
|
||||||
}
|
}
|
||||||
List<Block> substitutes = substitutions.get(desiredBlock);
|
List<Block> 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());
|
return withBlock(desired, current.getBlock());
|
||||||
}
|
}
|
||||||
for (Block substitute : substitutes) {
|
for (Block substitute : substitutes) {
|
||||||
if (substitute.equals(Blocks.AIR)) {
|
if (substitute instanceof BlockAir) {
|
||||||
return Blocks.AIR.getDefaultState(); // can always "place" air
|
return current.getBlock() instanceof BlockAir ? current : Blocks.AIR.getDefaultState(); // can always "place" air
|
||||||
}
|
}
|
||||||
for (IBlockState placeable : approxPlaceable) {
|
for (IBlockState placeable : approxPlaceable) {
|
||||||
if (substitute.equals(placeable.getBlock())) {
|
if (substitute.equals(placeable.getBlock())) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user