This commit is contained in:
MattBDev
2019-06-25 13:07:47 -04:00
parent a1c15e1c39
commit a69b239848
143 changed files with 1042 additions and 2405 deletions

View File

@ -61,25 +61,27 @@ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTo
if (applied.getBlockType().getMaterial().isAir()) {
eS.setBlock(blockPoint, secondary);
} else {
eS.setBlock(pos.subtract(pos.getDirection()).toBlockPoint(), secondary);
eS.setBlock(pos.toVector().subtract(pos.getDirection()).toBlockPoint(), secondary);
}
return true;
} catch (MaxChangedBlocksException e) {
// one block? eat it
}
return false;
}
@Override
public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session) {
Location pos = getTargetFace(player);
if (pos == null) return false;
try (EditSession eS = session.createEditSession(player)) {
BlockVector3 blockPoint = pos.toBlockPoint();
BlockVector3 blockPoint = pos.toVector().toBlockPoint();
BaseBlock applied = primary.apply(blockPoint);
if (applied.getBlockType().getMaterial().isAir()) {
eS.setBlock(blockPoint, primary);
} else {
eS.setBlock(pos.subtract(pos.getDirection()).toBlockPoint(), primary);
eS.setBlock(pos.toVector().subtract(pos.getDirection()).toBlockPoint(), primary);
}
return true;
} catch (MaxChangedBlocksException e) {
@ -99,4 +101,4 @@ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTo
return target;
}
}
}