diff --git a/src/main/java/io/github/eatmyvenom/litematicin/utils/Printer.java b/src/main/java/io/github/eatmyvenom/litematicin/utils/Printer.java index f1bcf40a..d0610049 100644 --- a/src/main/java/io/github/eatmyvenom/litematicin/utils/Printer.java +++ b/src/main/java/io/github/eatmyvenom/litematicin/utils/Printer.java @@ -59,6 +59,7 @@ import net.minecraft.block.FenceGateBlock; import net.minecraft.block.FurnaceBlock; import net.minecraft.block.FluidBlock; +import net.minecraft.block.GlazedTerracottaBlock; import net.minecraft.block.HopperBlock; import net.minecraft.block.LadderBlock; import net.minecraft.block.LecternBlock; @@ -764,7 +765,7 @@ else if (sBlock instanceof ObserverBlock || sBlock instanceof PistonBlock) { Vec3d hitPos = new Vec3d(offX, offY, offZ); // Carpet Accurate Placement protocol support, plus BlockSlab support hitPos = applyHitVec(npos, stateSchematic, hitPos, side); - if(CanUseProtocol) {hitPos = applyCarpetProtocolHitVec(npos,stateSchematic,hitPos);} else {hitPos = applyHitVec(npos, stateSchematic, hitPos, side);} + if(CanUseProtocol && IsBlockSupportedCarpet(stateSchematic.getBlock())) {hitPos = applyCarpetProtocolHitVec(npos,stateSchematic,hitPos);} else {hitPos = applyHitVec(npos, stateSchematic, hitPos, side);} // Mark that this position has been handled (use the non-offset position that is // checked above) @@ -1022,6 +1023,13 @@ public static Vec3d applyHitVec(BlockPos pos, BlockState state, Vec3d hitVecIn, * Gets the direction necessary to build the block oriented correctly. TODO: * Need a better way to do this. */ + private static Boolean IsBlockSupportedCarpet(Block SchematicBlock){ + if (SchematicBlock instanceof GlazedTerracottaBlock || SchematicBlock instanceof ObserverBlock || SchematicBlock instanceof RepeaterBlock || SchematicBlock instanceof TrapdoorBlock || + SchematicBlock instanceof ComparatorBlock || SchematicBlock instanceof DispenserBlock || SchematicBlock instanceof PistonBlock || SchematicBlock instanceof StairsBlock) + {return true;} + return false; + + } private static Direction applyPlacementFacing(BlockState stateSchematic, Direction side, BlockState stateClient) { Block blockSchematic = stateSchematic.getBlock(); Block blockClient = stateClient.getBlock();