forked from MagicBane/Server
Method moved to manager.
This commit is contained in:
@@ -351,14 +351,6 @@ public class HeightMap {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isLocUnderwater(Vector3fImmutable currentLoc) {
|
|
||||||
|
|
||||||
float localAltitude = HeightMap.getWorldHeight(currentLoc);
|
|
||||||
Zone zone = ZoneManager.findSmallestZone(currentLoc);
|
|
||||||
|
|
||||||
return localAltitude < zone.getSeaLevel();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void generatePixelData(HeightMap heightMap) {
|
private static void generatePixelData(HeightMap heightMap) {
|
||||||
|
|
||||||
Color color;
|
Color color;
|
||||||
|
|||||||
@@ -481,4 +481,12 @@ public enum ZoneManager {
|
|||||||
|
|
||||||
return worldAlttitude;
|
return worldAlttitude;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isLocUnderwater(Vector3fImmutable currentLoc) {
|
||||||
|
|
||||||
|
float localAltitude = HeightMap.getWorldHeight(currentLoc);
|
||||||
|
Zone zone = findSmallestZone(currentLoc);
|
||||||
|
|
||||||
|
return localAltitude < zone.getSeaLevel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package engine.net.client.handlers;
|
|||||||
|
|
||||||
import engine.Enum;
|
import engine.Enum;
|
||||||
import engine.Enum.*;
|
import engine.Enum.*;
|
||||||
import engine.InterestManagement.HeightMap;
|
|
||||||
import engine.InterestManagement.InterestManager;
|
import engine.InterestManagement.InterestManager;
|
||||||
import engine.InterestManagement.RealmMap;
|
import engine.InterestManagement.RealmMap;
|
||||||
import engine.InterestManagement.WorldGrid;
|
import engine.InterestManagement.WorldGrid;
|
||||||
@@ -112,7 +111,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
|
|
||||||
// Cannot place a tree underwater
|
// Cannot place a tree underwater
|
||||||
|
|
||||||
if (HeightMap.isLocUnderwater(placementInfo.getLoc())) {
|
if (ZoneManager.isLocUnderwater(placementInfo.getLoc())) {
|
||||||
PlaceAssetMsg.sendPlaceAssetError(origin, 6, ""); // Cannot place underwater
|
PlaceAssetMsg.sendPlaceAssetError(origin, 6, ""); // Cannot place underwater
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -178,7 +177,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
|
|
||||||
// Cannot place a building underwater
|
// Cannot place a building underwater
|
||||||
|
|
||||||
if (HeightMap.isLocUnderwater(placementInfo.getLoc())) {
|
if (ZoneManager.isLocUnderwater(placementInfo.getLoc())) {
|
||||||
PlaceAssetMsg.sendPlaceAssetError(origin, 6, ""); // Cannot place underwater
|
PlaceAssetMsg.sendPlaceAssetError(origin, 6, ""); // Cannot place underwater
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import engine.Enum;
|
|||||||
import engine.Enum.ProtectionState;
|
import engine.Enum.ProtectionState;
|
||||||
import engine.Enum.SiegePhase;
|
import engine.Enum.SiegePhase;
|
||||||
import engine.Enum.SiegeResult;
|
import engine.Enum.SiegeResult;
|
||||||
import engine.InterestManagement.HeightMap;
|
|
||||||
import engine.InterestManagement.WorldGrid;
|
import engine.InterestManagement.WorldGrid;
|
||||||
import engine.db.archive.BaneRecord;
|
import engine.db.archive.BaneRecord;
|
||||||
import engine.db.archive.DataWarehouse;
|
import engine.db.archive.DataWarehouse;
|
||||||
@@ -135,7 +134,7 @@ public final class Bane {
|
|||||||
|
|
||||||
// Cannot place banestone underwater;
|
// Cannot place banestone underwater;
|
||||||
|
|
||||||
if (HeightMap.isLocUnderwater(player.getLoc())) {
|
if (ZoneManager.isLocUnderwater(player.getLoc())) {
|
||||||
PlaceAssetMsg.sendPlaceAssetError(origin, 6, ""); // Cannot place underwater
|
PlaceAssetMsg.sendPlaceAssetError(origin, 6, ""); // Cannot place underwater
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user