Class ForgeChunkManager.TicketHelper

java.lang.Object
net.minecraftforge.common.world.ForgeChunkManager.TicketHelper
Enclosing class:
ForgeChunkManager

public static class ForgeChunkManager.TicketHelper extends Object
Class to help mods remove no longer valid tickets.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Map<BlockPos,com.mojang.datafixers.util.Pair<it.unimi.dsi.fastutil.longs.LongSet,it.unimi.dsi.fastutil.longs.LongSet>>
     
    private final Map<UUID,com.mojang.datafixers.util.Pair<it.unimi.dsi.fastutil.longs.LongSet,it.unimi.dsi.fastutil.longs.LongSet>>
     
    private final String
     
    private final ForcedChunksSavedData
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    TicketHelper(ForcedChunksSavedData saveData, String modId, Map<BlockPos,com.mojang.datafixers.util.Pair<it.unimi.dsi.fastutil.longs.LongSet,it.unimi.dsi.fastutil.longs.LongSet>> blockTickets, Map<UUID,com.mojang.datafixers.util.Pair<it.unimi.dsi.fastutil.longs.LongSet,it.unimi.dsi.fastutil.longs.LongSet>> entityTickets)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Map<BlockPos,com.mojang.datafixers.util.Pair<it.unimi.dsi.fastutil.longs.LongSet,it.unimi.dsi.fastutil.longs.LongSet>>
    Gets all "BLOCK" tickets this mod had registered and which block positions are forcing which chunks.
    Map<UUID,com.mojang.datafixers.util.Pair<it.unimi.dsi.fastutil.longs.LongSet,it.unimi.dsi.fastutil.longs.LongSet>>
    Gets all "ENTITY" tickets this mod had registered and which entity (UUID) is forcing which chunks.
    void
    Removes all tickets that a given entity (UUID) was responsible for; both ticking and not ticking.
    void
    Removes all tickets that a given block was responsible for; both ticking and not ticking.
    private <T extends Comparable<? super T>>
    void
    Removes all tickets that a given owner was responsible for; both ticking and not ticking.
    void
    removeTicket(UUID owner, long chunk, boolean ticking)
    Removes the ticket for the given chunk that a given entity (UUID) was responsible for.
    void
    removeTicket(BlockPos owner, long chunk, boolean ticking)
    Removes the ticket for the given chunk that a given block was responsible for.
    private <T extends Comparable<? super T>>
    void
    removeTicket(ForgeChunkManager.TicketTracker<T> tickets, T owner, long chunk, boolean ticking)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • blockTickets

      private final Map<BlockPos,com.mojang.datafixers.util.Pair<it.unimi.dsi.fastutil.longs.LongSet,it.unimi.dsi.fastutil.longs.LongSet>> blockTickets
    • entityTickets

      private final Map<UUID,com.mojang.datafixers.util.Pair<it.unimi.dsi.fastutil.longs.LongSet,it.unimi.dsi.fastutil.longs.LongSet>> entityTickets
    • saveData

      private final ForcedChunksSavedData saveData
    • modId

      private final String modId
  • Constructor Details

    • TicketHelper

      private TicketHelper(ForcedChunksSavedData saveData, String modId, Map<BlockPos,com.mojang.datafixers.util.Pair<it.unimi.dsi.fastutil.longs.LongSet,it.unimi.dsi.fastutil.longs.LongSet>> blockTickets, Map<UUID,com.mojang.datafixers.util.Pair<it.unimi.dsi.fastutil.longs.LongSet,it.unimi.dsi.fastutil.longs.LongSet>> entityTickets)
  • Method Details

    • getBlockTickets

      public Map<BlockPos,com.mojang.datafixers.util.Pair<it.unimi.dsi.fastutil.longs.LongSet,it.unimi.dsi.fastutil.longs.LongSet>> getBlockTickets()
      Gets all "BLOCK" tickets this mod had registered and which block positions are forcing which chunks. First element of the pair is the non-fully ticking tickets, second element is the fully ticking tickets.
      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,com.mojang.datafixers.util.Pair<it.unimi.dsi.fastutil.longs.LongSet,it.unimi.dsi.fastutil.longs.LongSet>> getEntityTickets()
      Gets all "ENTITY" tickets this mod had registered and which entity (UUID) is forcing which chunks. First element of the pair is the non-fully ticking tickets, second element is the fully ticking tickets.
      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 ticking and not ticking.
      Parameters:
      owner - Block that was responsible.
    • removeAllTickets

      public void removeAllTickets(UUID owner)
      Removes all tickets that a given entity (UUID) was responsible for; both ticking and not ticking.
      Parameters:
      owner - Entity (UUID) that was responsible.
    • removeAllTickets

      private <T extends Comparable<? super T>> void removeAllTickets(ForgeChunkManager.TicketTracker<T> tickets, T owner)
      Removes all tickets that a given owner was responsible for; both ticking and not ticking.
    • removeTicket

      public void removeTicket(BlockPos owner, long chunk, boolean ticking)
      Removes the ticket for the given chunk that a given block was responsible for.
      Parameters:
      owner - Block that was responsible.
      chunk - Chunk to remove ticket of.
      ticking - Whether or not the ticket to remove represents a ticking set of tickets or not.
    • removeTicket

      public void removeTicket(UUID owner, long chunk, boolean ticking)
      Removes the ticket for the given chunk that a given entity (UUID) was responsible for.
      Parameters:
      owner - Entity (UUID) that was responsible.
      chunk - Chunk to remove ticket of.
      ticking - Whether or not the ticket to remove represents a ticking set of tickets or not.
    • removeTicket

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