Fix sspl with visual enabled
This commit is contained in:
parent
147cfeed10
commit
6400505807
@ -1,6 +1,7 @@
|
||||
package com.boydti.fawe.object.brush;
|
||||
|
||||
import com.boydti.fawe.config.BBC;
|
||||
import com.boydti.fawe.object.brush.visualization.VisualExtent;
|
||||
import com.boydti.fawe.object.collection.LocalBlockVectorSet;
|
||||
import com.boydti.fawe.util.MathMan;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
@ -28,12 +29,14 @@ public class SurfaceSpline implements Brush {
|
||||
@Override
|
||||
public void build(EditSession editSession, Vector pos, Pattern pattern, double radius) throws MaxChangedBlocksException {
|
||||
int maxY = editSession.getMaxY();
|
||||
boolean vis = editSession.getExtent() instanceof VisualExtent;
|
||||
if (path.isEmpty() || !pos.equals(path.get(path.size() - 1))) {
|
||||
int max = editSession.getNearestSurfaceTerrainBlock(pos.getBlockX(), pos.getBlockZ(), pos.getBlockY(), 0, editSession.getMaxY());
|
||||
pos.mutY(max);
|
||||
path.add(pos);
|
||||
editSession.getPlayer().sendMessage(BBC.getPrefix() + BBC.BRUSH_SPLINE_PRIMARY_2.s());
|
||||
} else{
|
||||
if (!vis) return;
|
||||
}
|
||||
LocalBlockVectorSet vset = new LocalBlockVectorSet();
|
||||
final List<Node> nodes = new ArrayList<>(path.size());
|
||||
final KochanekBartelsInterpolation interpol = new KochanekBartelsInterpolation();
|
||||
@ -75,8 +78,8 @@ public class SurfaceSpline implements Brush {
|
||||
}
|
||||
}
|
||||
editSession.setBlocks(newSet, pattern);
|
||||
if (!vis) path.clear();
|
||||
}
|
||||
editSession.getPlayer().sendMessage(BBC.getPrefix() + BBC.BRUSH_SPLINE_SECONDARY.s());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user