Make Schematica respect mapArtMode setting
This commit is contained in:
parent
eee705b371
commit
d712839c25
@ -141,9 +141,14 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
|
|||||||
@Override
|
@Override
|
||||||
public void buildOpenSchematic() {
|
public void buildOpenSchematic() {
|
||||||
if (SchematicaHelper.isSchematicaPresent()) {
|
if (SchematicaHelper.isSchematicaPresent()) {
|
||||||
Optional<Tuple<ISchematic, BlockPos>> schematic = SchematicaHelper.getOpenSchematic();
|
Optional<Tuple<IStaticSchematic, BlockPos>> schematic = SchematicaHelper.getOpenSchematic();
|
||||||
if (schematic.isPresent()) {
|
if (schematic.isPresent()) {
|
||||||
this.build(schematic.get().getFirst().toString(), schematic.get().getFirst(), schematic.get().getSecond());
|
IStaticSchematic s = schematic.get().getFirst();
|
||||||
|
this.build(
|
||||||
|
schematic.get().getFirst().toString(),
|
||||||
|
Baritone.settings().mapArtMode.value ? new MapArtSchematic(s) : s,
|
||||||
|
schematic.get().getSecond()
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
logDirect("No schematic currently open");
|
logDirect("No schematic currently open");
|
||||||
}
|
}
|
||||||
|
@ -17,14 +17,14 @@
|
|||||||
|
|
||||||
package baritone.utils.schematic.schematica;
|
package baritone.utils.schematic.schematica;
|
||||||
|
|
||||||
import baritone.api.schematic.ISchematic;
|
import baritone.api.schematic.IStaticSchematic;
|
||||||
import com.github.lunatrius.schematica.client.world.SchematicWorld;
|
import com.github.lunatrius.schematica.client.world.SchematicWorld;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public final class SchematicAdapter implements ISchematic {
|
public final class SchematicAdapter implements IStaticSchematic {
|
||||||
|
|
||||||
private final SchematicWorld schematic;
|
private final SchematicWorld schematic;
|
||||||
|
|
||||||
@ -34,7 +34,12 @@ public final class SchematicAdapter implements ISchematic {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState desiredState(int x, int y, int z, IBlockState current, List<IBlockState> approxPlaceable) {
|
public IBlockState desiredState(int x, int y, int z, IBlockState current, List<IBlockState> approxPlaceable) {
|
||||||
return schematic.getSchematic().getBlockState(new BlockPos(x, y, z));
|
return this.getDirect(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IBlockState getDirect(int x, int y, int z) {
|
||||||
|
return this.schematic.getSchematic().getBlockState(new BlockPos(x, y, z));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
package baritone.utils.schematic.schematica;
|
package baritone.utils.schematic.schematica;
|
||||||
|
|
||||||
import baritone.api.schematic.ISchematic;
|
import baritone.api.schematic.IStaticSchematic;
|
||||||
import com.github.lunatrius.schematica.Schematica;
|
import com.github.lunatrius.schematica.Schematica;
|
||||||
import com.github.lunatrius.schematica.proxy.ClientProxy;
|
import com.github.lunatrius.schematica.proxy.ClientProxy;
|
||||||
import net.minecraft.util.Tuple;
|
import net.minecraft.util.Tuple;
|
||||||
@ -37,7 +37,7 @@ public enum SchematicaHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<Tuple<ISchematic, BlockPos>> getOpenSchematic() {
|
public static Optional<Tuple<IStaticSchematic, BlockPos>> getOpenSchematic() {
|
||||||
return Optional.ofNullable(ClientProxy.schematic)
|
return Optional.ofNullable(ClientProxy.schematic)
|
||||||
.map(world -> new Tuple<>(new SchematicAdapter(world), world.position));
|
.map(world -> new Tuple<>(new SchematicAdapter(world), world.position));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user