mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 03:56:41 +00:00
Added support for non-128 worldheights
This commit is contained in:
@ -44,8 +44,8 @@ public class CuboidSelection extends RegionSelection {
|
||||
if (pt2 == null) {
|
||||
throw new IllegalArgumentException("Null point 2 not permitted");
|
||||
}
|
||||
|
||||
CuboidRegionSelector sel = new CuboidRegionSelector();
|
||||
|
||||
CuboidRegionSelector sel = new CuboidRegionSelector(BukkitUtil.getLocalWorld(world));
|
||||
sel.selectPrimary(pt1);
|
||||
sel.selectSecondary(pt2);
|
||||
|
||||
|
@ -21,8 +21,11 @@ package com.sk89q.worldedit.bukkit.selections;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.sk89q.worldedit.LocalWorld;
|
||||
import org.bukkit.World;
|
||||
import com.sk89q.worldedit.BlockVector2D;
|
||||
import com.sk89q.worldedit.bukkit.BukkitUtil;
|
||||
import com.sk89q.worldedit.regions.*;
|
||||
|
||||
public class Polygonal2DSelection extends RegionSelection {
|
||||
@ -36,13 +39,13 @@ public class Polygonal2DSelection extends RegionSelection {
|
||||
|
||||
public Polygonal2DSelection(World world, List<BlockVector2D> points, int minY, int maxY) {
|
||||
super(world);
|
||||
LocalWorld lWorld = BukkitUtil.getLocalWorld(world);
|
||||
|
||||
minY = Math.min(Math.max(0, minY), 127);
|
||||
maxY = Math.min(Math.max(0, maxY), 127);
|
||||
|
||||
Polygonal2DRegionSelector sel = new Polygonal2DRegionSelector();
|
||||
poly2d = new Polygonal2DRegion(points, minY, maxY);
|
||||
minY = Math.min(Math.max(0, minY), world.getMaxHeight());
|
||||
maxY = Math.min(Math.max(0, maxY), world.getMaxHeight());
|
||||
|
||||
Polygonal2DRegionSelector sel = new Polygonal2DRegionSelector(BukkitUtil.getLocalWorld(world));
|
||||
poly2d = new Polygonal2DRegion(lWorld, points, minY, maxY);
|
||||
sel.learnChanges();
|
||||
|
||||
setRegionSelector(sel);
|
||||
|
Reference in New Issue
Block a user