mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Clamped Y for //expand and //contract operations.
This commit is contained in:
parent
194e162638
commit
cca5f157f4
@ -472,6 +472,17 @@ public class Vector {
|
|||||||
&& getBlockZ() >= min.getBlockZ() && getBlockZ() <= max.getBlockY();
|
&& getBlockZ() >= min.getBlockZ() && getBlockZ() <= max.getBlockY();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clamp the Y component.
|
||||||
|
*
|
||||||
|
* @param min
|
||||||
|
* @param max
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Vector clampY(int min, int max) {
|
||||||
|
return new Vector(x, Math.max(min, Math.min(max, y)), z);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 2D transformation.
|
* 2D transformation.
|
||||||
*
|
*
|
||||||
|
@ -168,6 +168,9 @@ public class CuboidRegion implements Region {
|
|||||||
pos2 = pos2.add(new Vector(0, 0, change.getZ()));
|
pos2 = pos2.add(new Vector(0, 0, change.getZ()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pos1 = pos1.clampY(0, 127);
|
||||||
|
pos2 = pos2.clampY(0, 127);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -217,6 +220,9 @@ public class CuboidRegion implements Region {
|
|||||||
pos2 = pos2.add(new Vector(0, 0, change.getZ()));
|
pos2 = pos2.add(new Vector(0, 0, change.getZ()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pos1 = pos1.clampY(0, 127);
|
||||||
|
pos2 = pos2.clampY(0, 127);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user