|
|
|
@ -25,7 +25,10 @@ import org.pmw.tinylog.Logger;
@@ -25,7 +25,10 @@ import org.pmw.tinylog.Logger;
|
|
|
|
|
import java.time.Instant; |
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.time.ZoneId; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Collection; |
|
|
|
|
import java.util.Collections; |
|
|
|
|
import java.util.Set; |
|
|
|
|
import java.util.concurrent.ConcurrentHashMap; |
|
|
|
|
import java.util.concurrent.ThreadLocalRandom; |
|
|
|
|
|
|
|
|
@ -46,7 +49,7 @@ public enum ZoneManager {
@@ -46,7 +49,7 @@ public enum ZoneManager {
|
|
|
|
|
public static Instant hotZoneLastUpdate; |
|
|
|
|
public static Zone hotZone = null; |
|
|
|
|
public static int hotZoneCycle = 0; // Used with HOTZONE_DURATION from config.
|
|
|
|
|
public static HashMap<Integer, Vector2f> _zone_size_data = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
/* Instance variables */ |
|
|
|
|
private static Zone seaFloor = null; |
|
|
|
|
|
|
|
|
@ -71,7 +74,7 @@ public enum ZoneManager {
@@ -71,7 +74,7 @@ public enum ZoneManager {
|
|
|
|
|
|
|
|
|
|
// Find smallest zone coordinates fit into.
|
|
|
|
|
|
|
|
|
|
public static final Zone findSmallestZone(final Vector3fImmutable loc) { |
|
|
|
|
public static Zone findSmallestZone(final Vector3fImmutable loc) { |
|
|
|
|
|
|
|
|
|
Zone zone = ZoneManager.seaFloor; |
|
|
|
|
|
|
|
|
@ -90,7 +93,7 @@ public enum ZoneManager {
@@ -90,7 +93,7 @@ public enum ZoneManager {
|
|
|
|
|
if (nodes != null) |
|
|
|
|
for (Zone child : nodes) { |
|
|
|
|
|
|
|
|
|
if (Bounds.collide(loc, child.bounds) == true) { |
|
|
|
|
if (Bounds.collide(loc, child.bounds)) { |
|
|
|
|
zone = child; |
|
|
|
|
childFound = true; |
|
|
|
|
break; |
|
|
|
@ -148,11 +151,11 @@ public enum ZoneManager {
@@ -148,11 +151,11 @@ public enum ZoneManager {
|
|
|
|
|
return ZoneManager.zonesByName.get(zoneName); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static final Collection<Zone> getAllZones() { |
|
|
|
|
public static Collection<Zone> getAllZones() { |
|
|
|
|
return ZoneManager.zonesByUUID.values(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static final void setHotZone(final Zone zone) { |
|
|
|
|
public static void setHotZone(final Zone zone) { |
|
|
|
|
|
|
|
|
|
if (!zone.isMacroZone()) |
|
|
|
|
return; |
|
|
|
@ -169,7 +172,7 @@ public enum ZoneManager {
@@ -169,7 +172,7 @@ public enum ZoneManager {
|
|
|
|
|
if (ZoneManager.hotZone == null) |
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
return (Bounds.collide(loc, ZoneManager.hotZone.bounds) == true); |
|
|
|
|
return (Bounds.collide(loc, ZoneManager.hotZone.bounds)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static Zone getSeaFloor() { |
|
|
|
@ -180,7 +183,7 @@ public enum ZoneManager {
@@ -180,7 +183,7 @@ public enum ZoneManager {
|
|
|
|
|
ZoneManager.seaFloor = value; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static final void populateWorldZones(final Zone zone) { |
|
|
|
|
public static void populateWorldZones(final Zone zone) { |
|
|
|
|
|
|
|
|
|
int loadNum = zone.template; |
|
|
|
|
|
|
|
|
|