mirror of https://github.com/cabaletta/baritone
Consistently use helper method
and make a safe cast unnecessary
This commit is contained in:
parent
632e05c4c2
commit
2a2842361b
|
@ -177,15 +177,15 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
|
|||
if (!format.isPresent()) {
|
||||
return false;
|
||||
}
|
||||
ISchematic parsed;
|
||||
IStaticSchematic parsed;
|
||||
try {
|
||||
parsed = format.get().parse(new FileInputStream(schematic));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
parsed = applyMapArtAndSelection(origin, (IStaticSchematic) parsed);
|
||||
build(name, parsed, origin);
|
||||
ISchematic schem = applyMapArtAndSelection(origin, parsed);
|
||||
build(name, schem, origin);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -205,17 +205,10 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
|
|||
if (SchematicaHelper.isSchematicaPresent()) {
|
||||
Optional<Tuple<IStaticSchematic, BlockPos>> schematic = SchematicaHelper.getOpenSchematic();
|
||||
if (schematic.isPresent()) {
|
||||
IStaticSchematic s = schematic.get().getA();
|
||||
IStaticSchematic raw = schematic.get().getA();
|
||||
BlockPos origin = schematic.get().getB();
|
||||
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().getA().toString(),
|
||||
schem,
|
||||
origin
|
||||
);
|
||||
ISchematic schem = applyMapArtAndSelection(origin, raw);
|
||||
this.build(raw.toString(), schem, origin);
|
||||
} else {
|
||||
logDirect("No schematic currently open");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue