类 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.
-
字段概要
字段 -
构造器概要
构造器构造器说明TicketHelper
(TicketStorage saveData, ResourceLocation controllerId, Map<BlockPos, TicketSet> blockTickets, Map<UUID, TicketSet> entityTickets) -
方法概要
修饰符和类型方法说明返回 all "BLOCK" tickets this controller had registered and which block positions are forcing which chunks。返回 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
(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
(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)
-
字段详细资料
-
blockTickets
-
entityTickets
-
saveData
-
controllerId
-
-
构造器详细资料
-
TicketHelper
TicketHelper(TicketStorage saveData, ResourceLocation controllerId, Map<BlockPos, TicketSet> blockTickets, Map<UUID, TicketSet> entityTickets)
-
-
方法详细资料
-
getBlockTickets
返回 all "BLOCK" tickets this controller had registered and which block positions are forcing which chunks。- 返回:
- all "BLOCK" tickets this controller had registered and which block positions are forcing which chunks
- 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
返回 all "ENTITY" tickets this controller had registered and which entity (UUID) is forcing which chunks。- 返回:
- all "ENTITY" tickets this controller had registered and which entity (UUID) is forcing which chunks
- 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
Removes all tickets that a given block was responsible for; both normal and ones forcing natural spawning.- 参数:
owner
- Block that was responsible.
-
removeAllTickets
Removes all tickets that a given entity (UUID) was responsible for; both normal and ones forcing natural spawning.- 参数:
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
Removes the ticket for the given chunk that a given block was responsible for.- 参数:
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.- 参数:
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)
-