Package net.minecraftforge.event.level
Class ChunkTicketLevelUpdatedEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.level.ChunkTicketLevelUpdatedEvent
public class ChunkTicketLevelUpdatedEvent
extends net.minecraftforge.eventbus.api.Event
This event is fired whenever a chunk has its ticket level changed via the server's ChunkMap.
 
This event does not fire if the new ticket level is the same as the old level, or if both the new AND old ticket levels represent values past the max chunk distance.
Due to how vanilla processes ticket level changes this event may be fired "twice" in one tick for the same chunk. The scenario where this happens is when increasing the level from say 31 (ticking) to 32, the way vanilla does it is by first changing it from 31 to 46, and then queuing the update from 46 to 32. However, when going from 32 to 31, vanilla is able to go directly.
This event is not cancellable and does not have a result.
This event is fired on the main Forge event bus only on the logical server.
- 
Nested Class SummaryNested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Eventnet.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final @Nullable ChunkHolderprivate final longprivate final ServerLevelprivate final intprivate final int
- 
Constructor SummaryConstructorsConstructorDescriptionChunkTicketLevelUpdatedEvent(ServerLevel level, long chunkPos, int oldTicketLevel, int newTicketLevel, @Nullable ChunkHolder chunkHolder) 
- 
Method SummaryModifier and TypeMethodDescription@Nullable ChunkHolderReturns chunk that had its ticket level updated.longReturns the long representation of the chunk position the ticket level changed for.getLevel()Returns the server level containing the chunk.intReturns the new ticket level for the chunk.intReturns the previous ticket level the chunk had.Methods inherited from class net.minecraftforge.eventbus.api.EventgetListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
- 
Field Details- 
level
- 
chunkPosprivate final long chunkPos
- 
oldTicketLevelprivate final int oldTicketLevel
- 
newTicketLevelprivate final int newTicketLevel
- 
chunkHolder
 
- 
- 
Constructor Details- 
ChunkTicketLevelUpdatedEventpublic ChunkTicketLevelUpdatedEvent(ServerLevel level, long chunkPos, int oldTicketLevel, int newTicketLevel, @Nullable @Nullable ChunkHolder chunkHolder) 
 
- 
- 
Method Details- 
getLevelReturns the server level containing the chunk.- Returns:
- the server level containing the chunk
 
- 
getChunkPospublic long getChunkPos()Returns the long representation of the chunk position the ticket level changed for.- Returns:
- the long representation of the chunk position the ticket level changed for
 
- 
getOldTicketLevelpublic int getOldTicketLevel()Returns the previous ticket level the chunk had.- Returns:
- the previous ticket level the chunk had
 
- 
getNewTicketLevelpublic int getNewTicketLevel()Returns the new ticket level for the chunk.- Returns:
- the new ticket level for the chunk
 
- 
getChunkHolderReturns chunk that had its ticket level updated.- Returns:
- chunk that had its ticket level updated
 
 
-