use of baritone.api.schematic.IStaticSchematic in project Spark-Client by Spark-Client-Development.
the class BuilderProcess method build.
@Override
public boolean build(String name, File schematic, Vec3i origin) {
Optional<ISchematicFormat> format = SchematicSystem.INSTANCE.getByFile(schematic);
if (!format.isPresent()) {
return false;
}
ISchematic parsed;
try {
parsed = format.get().parse(new FileInputStream(schematic));
} catch (Exception e) {
e.printStackTrace();
return false;
}
if (Baritone.settings().mapArtMode.getValue()) {
parsed = new MapArtSchematic((IStaticSchematic) parsed);
}
build(name, parsed, origin);
return true;
}
use of baritone.api.schematic.IStaticSchematic in project Spark-Client by Spark-Client-Development.
the class BuilderProcess method buildOpenSchematic.
@Override
public void buildOpenSchematic() {
if (SchematicaHelper.isSchematicaPresent()) {
Optional<Tuple<IStaticSchematic, BlockPos>> schematic = SchematicaHelper.getOpenSchematic();
if (schematic.isPresent()) {
IStaticSchematic s = schematic.get().getFirst();
this.build(schematic.get().getFirst().toString(), Baritone.settings().mapArtMode.getValue() ? new MapArtSchematic(s) : s, schematic.get().getSecond());
} else {
logDirect("No schematic currently open");
}
} else {
logDirect("Schematica is not present");
}
}
use of baritone.api.schematic.IStaticSchematic in project baritone by cabaletta.
the class BuilderProcess method buildOpenSchematic.
@Override
public void buildOpenSchematic() {
if (SchematicaHelper.isSchematicaPresent()) {
Optional<Tuple<IStaticSchematic, BlockPos>> schematic = SchematicaHelper.getOpenSchematic();
if (schematic.isPresent()) {
IStaticSchematic s = schematic.get().getFirst();
BlockPos origin = schematic.get().getSecond();
ISchematic schem = Baritone.settings().mapArtMode.value ? new MapArtSchematic(s) : s;
if (Baritone.settings().buildOnlySelection.value) {
schem = new SelectionSchematic(schem, origin, baritone.getSelectionManager().getSelections());
}
this.build(schematic.get().getFirst().toString(), schem, origin);
} else {
logDirect("No schematic currently open");
}
} else {
logDirect("Schematica is not present");
}
}
use of baritone.api.schematic.IStaticSchematic in project baritone by cabaletta.
the class BuilderProcess method build.
@Override
public boolean build(String name, File schematic, Vec3i origin) {
Optional<ISchematicFormat> format = SchematicSystem.INSTANCE.getByFile(schematic);
if (!format.isPresent()) {
return false;
}
ISchematic parsed;
try {
parsed = format.get().parse(new FileInputStream(schematic));
} catch (Exception e) {
e.printStackTrace();
return false;
}
if (Baritone.settings().mapArtMode.value) {
parsed = new MapArtSchematic((IStaticSchematic) parsed);
}
if (Baritone.settings().buildOnlySelection.value) {
parsed = new SelectionSchematic(parsed, origin, baritone.getSelectionManager().getSelections());
}
build(name, parsed, origin);
return true;
}
Aggregations