geforkt von Mirrors/FastAsyncWorldEdit
Add minimum/maximumY to FlatRegion and fix a typo in Polygonal2DRegion
Dieser Commit ist enthalten in:
Ursprung
6915244ab9
Commit
a7b49ff793
@ -87,6 +87,14 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
|
||||
Math.max(pos1.getZ(), pos2.getZ()));
|
||||
}
|
||||
|
||||
public int getMinimumY() {
|
||||
return Math.min(pos1.getBlockX(), pos2.getBlockY());
|
||||
}
|
||||
|
||||
public int getMaximumY() {
|
||||
return Math.max(pos1.getBlockX(), pos2.getBlockY());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the number of blocks in the region.
|
||||
*
|
||||
|
@ -23,5 +23,19 @@ import com.sk89q.worldedit.Vector2D;
|
||||
|
||||
public interface FlatRegion extends Region {
|
||||
|
||||
/**
|
||||
* Gets the minimum Y value
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getMinimumY();
|
||||
|
||||
/**
|
||||
* Gets the maximum Y value
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getMaximumY();
|
||||
|
||||
public Iterable<Vector2D> asFlatRegion();
|
||||
}
|
||||
|
@ -167,6 +167,11 @@ public class Polygonal2DRegion extends AbstractRegion implements FlatRegion {
|
||||
*
|
||||
* @return min y
|
||||
*/
|
||||
public int getMinimumY() {
|
||||
return minY;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public int getMininumY() {
|
||||
return minY;
|
||||
}
|
||||
|
@ -124,14 +124,14 @@ public class Polygonal2DRegionSelector implements RegionSelector, CUIRegion {
|
||||
|
||||
session.dispatchCUIEvent(player, new SelectionShapeEvent(getTypeID()));
|
||||
session.dispatchCUIEvent(player, new SelectionPoint2DEvent(0, pos, getArea()));
|
||||
session.dispatchCUIEvent(player, new SelectionMinMaxEvent(region.getMininumY(), region.getMaximumY()));
|
||||
session.dispatchCUIEvent(player, new SelectionMinMaxEvent(region.getMinimumY(), region.getMaximumY()));
|
||||
}
|
||||
|
||||
public void explainSecondarySelection(LocalPlayer player, LocalSession session, Vector pos) {
|
||||
player.print("Added point #" + region.size() + " at " + pos + ".");
|
||||
|
||||
session.dispatchCUIEvent(player, new SelectionPoint2DEvent(region.size() - 1, pos, getArea()));
|
||||
session.dispatchCUIEvent(player, new SelectionMinMaxEvent(region.getMininumY(), region.getMaximumY()));
|
||||
session.dispatchCUIEvent(player, new SelectionMinMaxEvent(region.getMinimumY(), region.getMaximumY()));
|
||||
}
|
||||
|
||||
public void explainRegionAdjust(LocalPlayer player, LocalSession session) {
|
||||
@ -195,7 +195,7 @@ public class Polygonal2DRegionSelector implements RegionSelector, CUIRegion {
|
||||
session.dispatchCUIEvent(player, new SelectionPoint2DEvent(id, points.get(id), getArea()));
|
||||
}
|
||||
|
||||
session.dispatchCUIEvent(player, new SelectionMinMaxEvent(region.getMininumY(), region.getMaximumY()));
|
||||
session.dispatchCUIEvent(player, new SelectionMinMaxEvent(region.getMinimumY(), region.getMaximumY()));
|
||||
}
|
||||
|
||||
public void describeLegacyCUI(LocalSession session, LocalPlayer player) {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren