diff --git a/src/main/java/io/github/eatmyvenom/litematicin/LitematicaMixinMod.java b/src/main/java/io/github/eatmyvenom/litematicin/LitematicaMixinMod.java index b39695c8..f1fc689f 100644 --- a/src/main/java/io/github/eatmyvenom/litematicin/LitematicaMixinMod.java +++ b/src/main/java/io/github/eatmyvenom/litematicin/LitematicaMixinMod.java @@ -22,6 +22,8 @@ public class LitematicaMixinMod implements ModInitializer { public static final ConfigBoolean CLEAR_AREA_MODE = new ConfigBoolean("easyPlaceModeClearFluids", false, "It will try to place slime blocks at fluids anywhere to clear"); public static final ConfigBoolean CLEAR_AREA_MODE_COBBLESTONE = new ConfigBoolean("ClearFluidsUseCobblestone", false, "It will try to place Cobblestone at anywhere to clear"); public static final ConfigBoolean CLEAR_AREA_MODE_SNOWPREVENT = new ConfigBoolean("ClearSnowLayer", false, "It will try to place string when snow layer is found"); + public static final ConfigBoolean ACCURATE_BLOCK_PLACEMENT = new ConfigBoolean("AccurateBlockPlacement",false,"if carpet extra/quickcarpet enabled it, turn on"); + public static final ImmutableList betterList = ImmutableList.of( Configs.Generic.AREAS_PER_WORLD, //BETTER_RENDER_ORDER, @@ -57,7 +59,8 @@ public class LitematicaMixinMod implements ModInitializer { FLIPPIN_CACTUS, CLEAR_AREA_MODE, CLEAR_AREA_MODE_COBBLESTONE, - CLEAR_AREA_MODE_SNOWPREVENT + CLEAR_AREA_MODE_SNOWPREVENT, + ACCURATE_BLOCK_PLACEMENT ); @Override 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 39874bce..e469d826 100644 --- a/src/main/java/io/github/eatmyvenom/litematicin/utils/Printer.java +++ b/src/main/java/io/github/eatmyvenom/litematicin/utils/Printer.java @@ -11,6 +11,7 @@ import static io.github.eatmyvenom.litematicin.LitematicaMixinMod.CLEAR_AREA_MODE; import static io.github.eatmyvenom.litematicin.LitematicaMixinMod.CLEAR_AREA_MODE_COBBLESTONE; import static io.github.eatmyvenom.litematicin.LitematicaMixinMod.CLEAR_AREA_MODE_SNOWPREVENT; +import static io.github.eatmyvenom.litematicin.LitematicaMixinMod.ACCURATE_BLOCK_PLACEMENT; import java.util.ArrayList; import java.util.Date; import java.util.LinkedHashMap; @@ -28,6 +29,7 @@ import fi.dy.masa.litematica.util.InventoryUtils; import fi.dy.masa.litematica.util.RayTraceUtils; import fi.dy.masa.litematica.util.RayTraceUtils.RayTraceWrapper; +import fi.dy.masa.litematica.util.WorldUtils; import fi.dy.masa.litematica.world.SchematicWorldHandler; import fi.dy.masa.malilib.util.IntBoundingBox; import fi.dy.masa.malilib.util.LayerRange; @@ -271,6 +273,7 @@ public static ActionResult doPrinterAction(MinecraftClient mc) { int posZ = tracePos.getZ(); boolean ClearArea = CLEAR_AREA_MODE.getBooleanValue(); // if its true, will ignore everything and remove fluids. boolean UseCobble = CLEAR_AREA_MODE_COBBLESTONE.getBooleanValue(); + boolean CanUseProtocol = ACCURATE_BLOCK_PLACEMENT.getBooleanValue(); SubChunkPos cpos = new SubChunkPos(tracePos); List list = DataManager.getSchematicPlacementManager().getAllPlacementsTouchingSubChunk(cpos); @@ -611,7 +614,7 @@ else if (sBlock instanceof ObserverBlock || sBlock instanceof PistonBlock) { .getFirstPropertyFacingValue(stateSchematic); if (facing != null) { FacingData facedata = getFacingData(stateSchematic); - if (!canPlaceFace(facedata, stateSchematic, mc.player, primaryFacing, horizontalFacing)) + if (!CanUseProtocol && !canPlaceFace(facedata, stateSchematic, mc.player, primaryFacing, horizontalFacing)) continue; if ((stateSchematic.getBlock() instanceof DoorBlock @@ -745,6 +748,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 = WorldUtils.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)