类 TicketHelper

java.lang.Object
net.neoforged.neoforge.common.world.chunk.TicketHelper

public class TicketHelper extends Object
Class to help mods remove no longer valid tickets before they are activated on load.
  • 字段详细资料

  • 构造器详细资料

  • 方法详细资料

    • getBlockTickets

      public Map<BlockPos,TicketSet> getBlockTickets()
      返回 all "BLOCK" tickets this controller had registered and which block positions are forcing which chunks。
      返回:
      all "BLOCK" tickets this controller had registered and which block positions are forcing which chunks
      API Note:
      This map is unmodifiable and does not update to reflect removed tickets so it is safe to call the remove methods while iterating it.
    • getEntityTickets

      public Map<UUID,TicketSet> getEntityTickets()
      返回 all "ENTITY" tickets this controller had registered and which entity (UUID) is forcing which chunks。
      返回:
      all "ENTITY" tickets this controller had registered and which entity (UUID) is forcing which chunks
      API Note:
      This map is unmodifiable and does not update to reflect removed tickets so it is safe to call the remove methods while iterating it.
    • removeAllTickets

      public void removeAllTickets(BlockPos owner)
      Removes all tickets that a given block was responsible for; both normal and ones forcing natural spawning.
      参数:
      owner - Block that was responsible.
    • removeAllTickets

      public void removeAllTickets(UUID owner)
      Removes all tickets that a given entity (UUID) was responsible for; both normal and ones forcing natural spawning.
      参数:
      owner - Entity (UUID) that was responsible.
    • removeAllTickets

      private <T extends Comparable<? super T>> void removeAllTickets(ForcedChunkManager.TicketTracker<T> tickets, T owner, @Nullable @Nullable TicketSet existingTickets)
      Removes all tickets that a given owner was responsible for; both normal and ones forcing natural spawning.
    • removeTicket

      public void removeTicket(BlockPos owner, long chunk, boolean forceNaturalSpawning)
      Removes the ticket for the given chunk that a given block was responsible for.
      参数:
      owner - block that was responsible
      chunk - chunk to remove ticket of
      forceNaturalSpawning - whether the ticket to remove represents a ticket that is forcing natural spawning
    • removeTicket

      public void removeTicket(UUID owner, long chunk, boolean forceNaturalSpawning)
      Removes the ticket for the given chunk that a given entity (UUID) was responsible for.
      参数:
      owner - entity (UUID) that was responsible
      chunk - chunk to remove ticket of
      forceNaturalSpawning - whether the ticket to remove represents a ticket that is forcing natural spawning
    • removeTicket

      private <T extends Comparable<? super T>> void removeTicket(ForcedChunkManager.TicketTracker<T> tickets, T owner, long chunk, boolean forceNaturalSpawning)