Package net.minecraftforge.common.world
Class ForgeChunkManager.TicketHelper
- java.lang.Object
-
- net.minecraftforge.common.world.ForgeChunkManager.TicketHelper
-
- Enclosing class:
- ForgeChunkManager
public static class ForgeChunkManager.TicketHelper extends java.lang.ObjectClass 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>>blockTicketsprivate java.util.Map<java.util.UUID,com.mojang.datafixers.util.Pair<it.unimi.dsi.fastutil.longs.LongSet,it.unimi.dsi.fastutil.longs.LongSet>>entityTicketsprivate java.lang.StringmodIdprivate ForcedChunksSaveDatasaveData
-
Constructor Summary
Constructors Modifier Constructor Description privateTicketHelper(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.voidremoveAllTickets(java.util.UUID owner)Removes all tickets that a given entity (UUID) was responsible for; both ticking and not ticking.voidremoveAllTickets(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>>
voidremoveAllTickets(ForgeChunkManager.TicketTracker<T> tickets, T owner)Removes all tickets that a given owner was responsible for; both ticking and not ticking.voidremoveTicket(java.util.UUID owner, long chunk, boolean ticking)Removes the ticket for the given chunk that a given entity (UUID) was responsible for.voidremoveTicket(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>>
voidremoveTicket(ForgeChunkManager.TicketTracker<T> tickets, T owner, long chunk, boolean ticking)
-
-
-
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
-
saveData
private final ForcedChunksSaveData saveData
-
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)
-
-