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

  • Constructor Details

    • WorldMapTracker

      public WorldMapTracker(@Nonnull Player player)
      Default Constructor for a WorldMapTracker instance
      Parameters:
      player - The associated Player instance
  • Method Details

    • setPlayerUuid

      public void setPlayerUuid(@Nonnull UUID uuid)
    • unregisterEvents

      public void unregisterEvents()
    • tick

      public void tick(float dt)
      Description copied from interface: Tickable
      Delta time in seconds
      Specified by:
      tick in interface Tickable
      Parameters:
      dt - the time delta in seconds
    • updateCurrentZoneAndBiome

      public void updateCurrentZoneAndBiome(@Nonnull Ref<EntityStore> ref, @Nullable WorldMapTracker.ZoneDiscoveryInfo zoneDiscoveryInfo, @Nullable String biomeName, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
      Called to update the current zone parameters for the player.
      Parameters:
      ref - The entity reference of the player entity.
      zoneDiscoveryInfo - The zone discovery info containing zone details, or null if not in a zone.
      biomeName - The name of the biome the player is currently in.
      componentAccessor - The ComponentAccessor<EntityStore> for component access.
    • getSentMarkers

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

      @Nonnull public Player getPlayer()
    • getTransformComponent

      @Nullable public TransformComponent getTransformComponent()
    • clear

      public void clear()
    • clearChunks

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

      public void sendSettings(@Nonnull World world)
    • discoverZone

      public boolean discoverZone(@Nonnull World world, @Nonnull String zoneName)
      Called to mark a zone as discovered for the player.
      Parameters:
      world - The world the player is in.
      zoneName - The name of the zone to discover.
      Returns:
      true if the zone was newly discovered; false if it was already discovered.
    • undiscoverZone

      public boolean undiscoverZone(@Nonnull World world, @Nonnull String zoneName)
      Called to mark a zone as undiscovered for the player.
      Parameters:
      world - The world the player is in.
      zoneName - The name of the zone to undiscover.
      Returns:
      true if the zone was undiscovered; false if it was not previously discovered.
    • discoverZones

      public boolean discoverZones(@Nonnull World world, @Nonnull Set<String> zoneNames)
      Called to mark multiple zones as discovered for the player.
      Parameters:
      world - The world the player is in.
      zoneNames - The set of zone names to discover.
      Returns:
      true if any zone was newly discovered; false if all were already discovered.
    • undiscoverZones

      public boolean undiscoverZones(@Nonnull World world, @Nonnull Set<String> zoneNames)
      Called to mark multiple zones as undiscovered for the player.
      Parameters:
      world - The world the player is in.
      zoneNames - The set of zone names to undiscover.
      Returns:
      true if any zone was undiscovered; false if none were previously discovered.
    • isAllowTeleportToCoordinates

      public static boolean isAllowTeleportToCoordinates(@Nonnull PlayerRef playerRef, @Nonnull Player player)
      Parameters:
      playerRef - The PlayerRef component of the player entity.
      player - The Player component of the player entity.
      Returns:
      true if teleporting to coordinates is allowed; false otherwise.
    • isAllowTeleportToMarkers

      public boolean isAllowTeleportToMarkers(@Nonnull PlayerRef playerRef, @Nonnull Player player)
      Parameters:
      playerRef - The PlayerRef component of the player entity.
      player - The Player component of the player entity.
      Returns:
      true if teleporting to markers is allowed; false otherwise.
    • setPlayerMapFilter

      public void setPlayerMapFilter(Predicate<PlayerRef> playerMapFilter)
    • 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

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