forked from MagicBane/Server
Blending configuration setup in SetParent()
This commit is contained in:
@@ -55,8 +55,8 @@ public class HeightMap {
|
||||
private float seaLevel = 0;
|
||||
private int[][] pixelColorValues;
|
||||
|
||||
private float zone_minBlend;
|
||||
private float zone_maxBlend;
|
||||
public float zone_minBlend;
|
||||
public float zone_maxBlend;
|
||||
|
||||
public HeightMap(ResultSet rs) throws SQLException {
|
||||
|
||||
|
||||
@@ -60,6 +60,10 @@ public class Zone extends AbstractGameObject {
|
||||
private float seaLevel = 0f;
|
||||
public static final Set<Mob> respawnQue = Collections.newSetFromMap(new ConcurrentHashMap<>());
|
||||
public static long lastRespawn = 0;
|
||||
|
||||
public Bounds minBlend;
|
||||
public Bounds maxBlend;
|
||||
|
||||
/**
|
||||
* ResultSet Constructor
|
||||
*/
|
||||
@@ -162,9 +166,6 @@ public class Zone extends AbstractGameObject {
|
||||
*/
|
||||
public void setBounds() {
|
||||
|
||||
float halfExtentX;
|
||||
float halfExtentY;
|
||||
|
||||
// Set initial bounds object
|
||||
|
||||
this.bounds = Bounds.borrow();
|
||||
@@ -185,6 +186,16 @@ public class Zone extends AbstractGameObject {
|
||||
else
|
||||
bounds.setBounds(new Vector2f(this.absX, this.absZ), new Vector2f(Enum.CityBoundsType.ZONE.extents, Enum.CityBoundsType.ZONE.extents), 0.0f);
|
||||
|
||||
HeightMap heightMap = this.getHeightMap();
|
||||
|
||||
// Set heightmap blending bounds
|
||||
|
||||
if (heightMap != null) {
|
||||
this.minBlend = Bounds.borrow();
|
||||
this.maxBlend.setBounds(new Vector2f(this.absX, this.absZ), new Vector2f(Enum.CityBoundsType.ZONE.extents, Enum.CityBoundsType.ZONE.extents).subtract(heightMap.zone_maxBlend, heightMap.zone_maxBlend), 0.0f);
|
||||
this.maxBlend.setBounds(new Vector2f(this.absX, this.absZ), new Vector2f(Enum.CityBoundsType.ZONE.extents, Enum.CityBoundsType.ZONE.extents).subtract(heightMap.zone_minBlend, heightMap.zone_minBlend), 0.0f);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public int getPlayerCityUUID() {
|
||||
|
||||
Reference in New Issue
Block a user