Class ForgeChunkManager.TicketHelper

  • Enclosing class:
    ForgeChunkManager

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

      Fields 
      Modifier and Type Field Description
      private java.util.Map<BlockPos,​com.mojang.datafixers.util.Pair<it.unimi.dsi.fastutil.longs.LongSet,​it.unimi.dsi.fastutil.longs.LongSet>> blockTickets  
      private java.util.Map<java.util.UUID,​com.mojang.datafixers.util.Pair<it.unimi.dsi.fastutil.longs.LongSet,​it.unimi.dsi.fastutil.longs.LongSet>> entityTickets  
      private java.lang.String modId  
      private ForcedChunksSaveData saveData  
    • Constructor Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.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.
      java.util.Map<java.util.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.
      void removeAllTickets​(java.util.UUID owner)
      Removes all tickets that a given entity (UUID) was responsible for; both ticking and not ticking.
      void removeAllTickets​(BlockPos owner)
      Removes all tickets that a given block was responsible for; both ticking and not ticking.
      private <T extends java.lang.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.
      void removeTicket​(java.util.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 java.lang.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 Detail

      • blockTickets

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

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

        private final java.lang.String modId
    • Constructor Detail

      • TicketHelper

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

      • getBlockTickets

        public java.util.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.
      • getEntityTickets

        public java.util.Map<java.util.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.
      • 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​(java.util.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 java.lang.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​(java.util.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 java.lang.Comparable<? super T>> void removeTicket​(ForgeChunkManager.TicketTracker<T> tickets,
                                                                              T owner,
                                                                              long chunk,
                                                                              boolean ticking)