Class WorldMapTracker

java.lang.Object
com.hypixel.hytale.server.core.universe.world.WorldMapTracker
All Implemented Interfaces:
Tickable

public class WorldMapTracker extends Object implements Tickable
  • Field Details

    • LOGGER

      private static final com.hypixel.hytale.logger.HytaleLogger LOGGER
    • UPDATE_SPEED

      public static final float UPDATE_SPEED
      See Also:
    • MIN_PLAYER_MARKER_UPDATE_SPEED

      public static final float MIN_PLAYER_MARKER_UPDATE_SPEED
      See Also:
    • RADIUS_MAX

      public static final int RADIUS_MAX
      See Also:
    • EMPTY_UPDATE_WORLD_MAP_SIZE

      public static final int EMPTY_UPDATE_WORLD_MAP_SIZE
      See Also:
    • EMPTY_MAP_CHUNK_SIZE

      private static final int EMPTY_MAP_CHUNK_SIZE
      See Also:
    • FULL_MAP_CHUNK_SIZE

      private static final int FULL_MAP_CHUNK_SIZE
      See Also:
    • MAX_IMAGE_GENERATION

      public static final int MAX_IMAGE_GENERATION
      See Also:
    • MAX_FRAME

      public static final int MAX_FRAME
      See Also:
    • player

      private final Player player
    • spiralIterator

      private final CircleSpiralIterator spiralIterator
    • loadedLock

      private final ReentrantReadWriteLock loadedLock
    • loaded

      private final HLongSet loaded
    • pendingReloadChunks

      private final HLongSet pendingReloadChunks
    • pendingReloadFutures

      private final it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<CompletableFuture<MapImage>> pendingReloadFutures
    • sentMarkers

      private final Map<String,MapMarker> sentMarkers
    • updateTimer

      private float updateTimer
    • playerMarkersUpdateTimer

      private float playerMarkersUpdateTimer
    • viewRadiusOverride

      private Integer viewRadiusOverride
    • started

      private boolean started
    • sentViewRadius

      private int sentViewRadius
    • lastChunkX

      private int lastChunkX
    • lastChunkZ

      private int lastChunkZ
    • currentBiomeName

      @Nullable private String currentBiomeName
    • currentZone

      @Nullable private WorldMapTracker.ZoneDiscoveryInfo currentZone
    • allowTeleportToCoordinates

      private boolean allowTeleportToCoordinates
    • allowTeleportToMarkers

      private boolean allowTeleportToMarkers
    • clientHasWorldMapVisible

      private boolean clientHasWorldMapVisible
    • playerMapFilter

      private Predicate<PlayerRef> playerMapFilter
    • tempToRemove

      @Nonnull private final Set<String> tempToRemove
    • tempToAdd

      @Nonnull private final Set<MapMarker> tempToAdd
    • tempTestedMarkers

      @Nonnull private final Set<String> tempTestedMarkers
    • transformComponent

      @Nullable private TransformComponent transformComponent
  • Constructor Details

    • WorldMapTracker

      public WorldMapTracker(@Nonnull Player player)
  • Method Details

    • tick

      public void tick(float dt)
      Specified by:
      tick in interface Tickable
    • updateCurrentZoneAndBiome

      public void updateCurrentZoneAndBiome(@Nonnull Ref<EntityStore> ref, @Nullable WorldMapTracker.ZoneDiscoveryInfo zoneDiscoveryInfo, @Nullable String biomeName, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
    • onZoneDiscovered

      private void onZoneDiscovered(@Nonnull Ref<EntityStore> ref, @Nonnull WorldMapTracker.ZoneDiscoveryInfo zoneDiscoveryInfo, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
    • updateWorldMap

      private void updateWorldMap(@Nonnull World world, float dt, @Nonnull WorldMapSettings worldMapSettings, int chunkViewRadius, int playerChunkX, int playerChunkZ)
    • updatePointsOfInterest

      private void updatePointsOfInterest(@Nonnull World world, int chunkViewRadius, int playerChunkX, int playerChunkZ)
    • trySendMarker

      public void trySendMarker(int chunkViewRadius, int playerChunkX, int playerChunkZ, @Nonnull MapMarker marker)
    • trySendMarker

      public <T> void trySendMarker(int chunkViewRadius, int playerChunkX, int playerChunkZ, @Nonnull Vector3d markerPos, float markerYaw, @Nonnull String markerId, @Nonnull String markerDisplayName, @Nonnull T param, @Nonnull TriFunction<String,String,T,MapMarker> markerSupplier)
    • trySendMarker

      private <T> void trySendMarker(int chunkViewRadius, int playerChunkX, int playerChunkZ, double markerX, double markerZ, float markerYaw, @Nonnull String markerId, @Nonnull String markerName, @Nonnull T param, @Nonnull TriFunction<String,String,T,MapMarker> markerSupplier)
    • unloadImages

      private void unloadImages(int chunkViewRadius, int playerChunkX, int playerChunkZ)
    • processPendingReloadChunks

      private void processPendingReloadChunks(@Nonnull World world)
    • loadImages

      private int loadImages(@Nonnull World world, int chunkViewRadius, int playerChunkX, int playerChunkZ, int maxGeneration)
    • loadWorldMap

      private int loadWorldMap(@Nonnull World world, @Nonnull Box2D worldMapArea, int maxGeneration)
    • writeUpdatePacket

      private void writeUpdatePacket(@Nullable List<MapChunk> list)
    • getSentMarkers

      @Nonnull public Map<String,MapMarker> getSentMarkers()
    • getPlayer

      @Nonnull public Player getPlayer()
    • clear

      public void clear()
    • clearChunks

      public void clearChunks(@Nonnull it.unimi.dsi.fastutil.longs.LongSet chunkIndices)
    • sendSettings

      public void sendSettings(@Nonnull World world)
    • hasDiscoveredZone

      private boolean hasDiscoveredZone(@Nonnull String zoneName)
    • discoverZone

      public boolean discoverZone(@Nonnull World world, @Nonnull String zoneName)
    • undiscoverZone

      public boolean undiscoverZone(@Nonnull World world, @Nonnull String zoneName)
    • discoverZones

      public boolean discoverZones(@Nonnull World world, @Nonnull Set<String> zoneNames)
    • undiscoverZones

      public boolean undiscoverZones(@Nonnull World world, @Nonnull Set<String> zoneNames)
    • isAllowTeleportToCoordinates

      public boolean isAllowTeleportToCoordinates()
    • setAllowTeleportToCoordinates

      public void setAllowTeleportToCoordinates(@Nonnull World world, boolean allowTeleportToCoordinates)
    • isAllowTeleportToMarkers

      public boolean isAllowTeleportToMarkers()
    • setAllowTeleportToMarkers

      public void setAllowTeleportToMarkers(@Nonnull World world, boolean allowTeleportToMarkers)
    • getPlayerMapFilter

      public Predicate<PlayerRef> getPlayerMapFilter()
    • setPlayerMapFilter

      public void setPlayerMapFilter(Predicate<PlayerRef> playerMapFilter)
    • setClientHasWorldMapVisible

      public void setClientHasWorldMapVisible(boolean visible)
    • shouldUpdatePlayerMarkers

      public boolean shouldUpdatePlayerMarkers()
    • resetPlayerMarkersUpdateTimer

      public void resetPlayerMarkersUpdateTimer()
    • getViewRadiusOverride

      @Nullable public Integer getViewRadiusOverride()
    • getCurrentBiomeName

      @Nullable public String getCurrentBiomeName()
    • getCurrentZone

      @Nullable public WorldMapTracker.ZoneDiscoveryInfo getCurrentZone()
    • setViewRadiusOverride

      public void setViewRadiusOverride(@Nullable Integer viewRadiusOverride)
    • getEffectiveViewRadius

      public int getEffectiveViewRadius(@Nonnull World world)
    • shouldBeVisible

      public boolean shouldBeVisible(int chunkViewRadius, long chunkCoordinates)
    • copyFrom

      public void copyFrom(@Nonnull WorldMapTracker worldMapTracker)
    • shouldBeVisible

      private static boolean shouldBeVisible(int chunkViewRadius, int chunkX, int chunkZ, int x, int z)