Class TicketHelper
java.lang.Object
net.neoforged.neoforge.common.world.chunk.TicketHelper
Class to help mods remove no longer valid tickets before they are activated on load.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final net.minecraft.resources.ResourceLocation
private final net.minecraft.world.level.TicketStorage
-
Constructor Summary
Constructors -
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 normal and ones forcing natural spawning.void
removeAllTickets
(net.minecraft.core.BlockPos owner) Removes all tickets that a given block was responsible for; both normal and ones forcing natural spawning.private <T extends Comparable<? super T>>
voidremoveAllTickets
(ForcedChunkManager.TicketTracker<T> tickets, T owner, @Nullable TicketSet existingTickets) Removes all tickets that a given owner was responsible for; both normal and ones forcing natural spawning.void
removeTicket
(UUID owner, long chunk, boolean forceNaturalSpawning) Removes the ticket for the given chunk that a given entity (UUID) was responsible for.void
removeTicket
(net.minecraft.core.BlockPos owner, long chunk, boolean forceNaturalSpawning) 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 forceNaturalSpawning)
-
Field Details
-
blockTickets
-
entityTickets
-
saveData
private final net.minecraft.world.level.TicketStorage saveData -
controllerId
private final net.minecraft.resources.ResourceLocation controllerId
-
-
Constructor Details
-
TicketHelper
-
-
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
public void removeAllTickets(net.minecraft.core.BlockPos owner) Removes all tickets that a given block was responsible for; both normal and ones forcing natural spawning.- Parameters:
owner
- Block that was responsible.
-
removeAllTickets
Removes all tickets that a given entity (UUID) was responsible for; both normal and ones forcing natural spawning.- Parameters:
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(net.minecraft.core.BlockPos owner, long chunk, boolean forceNaturalSpawning) Removes the ticket for the given chunk that a given block was responsible for.- Parameters:
owner
- block that was responsiblechunk
- chunk to remove ticket offorceNaturalSpawning
- whether the ticket to remove represents a ticket that is forcing natural spawning
-
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 offorceNaturalSpawning
- 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)
-