Class TicketHelper
java.lang.Object
net.neoforged.neoforge.common.world.chunk.TicketHelper
Class to help mods remove no longer valid tickets.
-
Field Summary
Modifier and TypeFieldDescriptionprivate final ResourceLocation
private final ForcedChunksSavedData
-
Constructor Summary
ConstructorDescriptionTicketHelper
(ForcedChunksSavedData saveData, ResourceLocation controllerId, Map<BlockPos, TicketSet> blockTickets, Map<UUID, TicketSet> entityTickets) -
Method Summary
Modifier and TypeMethodDescriptionReturns all "BLOCK" tickets this controller had registered and which block positions are forcing which chunks.Returns all "ENTITY" tickets this controller had registered and which entity (UUID) is forcing which chunks.void
removeAllTickets
(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 Comparable<? super T>>
voidremoveAllTickets
(ForcedChunkManager.TicketTracker<T> tickets, T owner) 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>>
voidremoveTicket
(ForcedChunkManager.TicketTracker<T> tickets, T owner, long chunk, boolean ticking)
-
Field Details
-
blockTickets
-
entityTickets
-
saveData
-
controllerId
-
-
Constructor Details
-
TicketHelper
TicketHelper(ForcedChunksSavedData saveData, ResourceLocation controllerId, Map<BlockPos, TicketSet> blockTickets, Map<UUID, TicketSet> entityTickets)
-
-
Method Details
-
getBlockTickets
Returns all "BLOCK" tickets this controller had registered and which block positions are forcing which chunks.- Returns:
- all "BLOCK" tickets this controller had registered and which block positions are forcing which chunks
-
getEntityTickets
Returns all "ENTITY" tickets this controller had registered and which entity (UUID) is forcing which chunks.- Returns:
- all "ENTITY" tickets this controller had registered and which entity (UUID) is forcing which chunks
-
removeAllTickets
Removes all tickets that a given block was responsible for; both ticking and not ticking.- Parameters:
owner
- Block that was responsible.
-
removeAllTickets
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(ForcedChunkManager.TicketTracker<T> tickets, T owner) Removes all tickets that a given owner was responsible for; both ticking and not ticking. -
removeTicket
Removes the ticket for the given chunk that a given block was responsible for.- Parameters:
owner
- block that was responsiblechunk
- chunk to remove ticket ofticking
- whether or not the ticket to remove represents a ticking set of tickets or not
-
removeTicket
Removes the ticket for the given chunk that a given entity (UUID) was responsible for.- Parameters:
owner
- entity (UUID) that was responsiblechunk
- chunk to remove ticket ofticking
- whether or not the ticket to remove represents a ticking set of tickets or not
-
removeTicket
private <T extends Comparable<? super T>> void removeTicket(ForcedChunkManager.TicketTracker<T> tickets, T owner, long chunk, boolean ticking)
-