Utilize new FillSchematic

This commit is contained in:
Brady 2019-12-19 12:03:02 -06:00
parent 6759917a2f
commit eea5b69b6c
No known key found for this signature in database
GPG Key ID: 73A788379A197567
3 changed files with 5 additions and 42 deletions

View File

@ -32,15 +32,16 @@ public class FillSchematic extends AbstractSchematic {
this.bom = bom;
}
public FillSchematic(int x, int y, int z, IBlockState state) {
this(x, y, z, new BlockOptionalMeta(state.getBlock(), state.getBlock().getMetaFromState(state)));
}
public BlockOptionalMeta getBom() {
return bom;
}
@Override
public IBlockState desiredState(int x, int y, int z, IBlockState current, List<IBlockState> approxPlaceable) {
// TODO: is this even necessary???
// Builder will already handle logic that requires breaking blocks before replacing them, and non-api Fill Schematic
// is used for clear area and doesn't have any issues.
if (bom.matches(current)) {
return current;
} else if (current.getBlock() != Blocks.AIR) {

View File

@ -25,6 +25,7 @@ import baritone.api.pathing.goals.GoalGetToBlock;
import baritone.api.process.IBuilderProcess;
import baritone.api.process.PathingCommand;
import baritone.api.process.PathingCommandType;
import baritone.api.schematic.FillSchematic;
import baritone.api.schematic.ISchematic;
import baritone.api.utils.BetterBlockPos;
import baritone.api.utils.RayTraceUtils;
@ -37,7 +38,6 @@ import baritone.pathing.movement.MovementHelper;
import baritone.utils.BaritoneProcessHelper;
import baritone.utils.BlockStateInterface;
import baritone.utils.PathingCommandContext;
import baritone.utils.schematic.FillSchematic;
import baritone.utils.schematic.MapArtSchematic;
import baritone.utils.schematic.format.SchematicFormat;
import baritone.utils.schematic.schematica.SchematicaHelper;

View File

@ -1,38 +0,0 @@
/*
* This file is part of Baritone.
*
* Baritone is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Baritone is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Baritone. If not, see <https://www.gnu.org/licenses/>.
*/
package baritone.utils.schematic;
import baritone.api.schematic.AbstractSchematic;
import net.minecraft.block.state.IBlockState;
import java.util.List;
public class FillSchematic extends AbstractSchematic {
private final IBlockState state;
public FillSchematic(int widthX, int heightY, int lengthZ, IBlockState state) {
super(widthX, heightY, lengthZ);
this.state = state;
}
@Override
public IBlockState desiredState(int x, int y, int z, IBlockState current, List<IBlockState> approxPlaceable) {
return state;
}
}