类 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.
-
嵌套类概要
从类继承的嵌套类/接口 net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
字段概要
字段修饰符和类型字段说明private final @Nullable ChunkHolder
private final long
private final ServerLevel
private final int
private final int
-
构造器概要
构造器构造器说明ChunkTicketLevelUpdatedEvent
(ServerLevel level, long chunkPos, int oldTicketLevel, int newTicketLevel, @Nullable ChunkHolder chunkHolder) -
方法概要
修饰符和类型方法说明@Nullable ChunkHolder
返回 chunk that had its ticket level updated。long
返回 the long representation of the chunk position the ticket level changed for。getLevel()
返回 the server level containing the chunk。int
返回 the new ticket level for the chunk。int
返回 the previous ticket level the chunk had。从类继承的方法 net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
字段详细资料
-
level
-
chunkPos
private final long chunkPos -
oldTicketLevel
private final int oldTicketLevel -
newTicketLevel
private final int newTicketLevel -
chunkHolder
-
-
构造器详细资料
-
ChunkTicketLevelUpdatedEvent
public ChunkTicketLevelUpdatedEvent(ServerLevel level, long chunkPos, int oldTicketLevel, int newTicketLevel, @Nullable @Nullable ChunkHolder chunkHolder)
-
-
方法详细资料
-
getLevel
返回 the server level containing the chunk。- 返回:
- the server level containing the chunk
-
getChunkPos
public long getChunkPos()返回 the long representation of the chunk position the ticket level changed for。- 返回:
- the long representation of the chunk position the ticket level changed for
-
getOldTicketLevel
public int getOldTicketLevel()返回 the previous ticket level the chunk had。- 返回:
- the previous ticket level the chunk had
-
getNewTicketLevel
public int getNewTicketLevel()返回 the new ticket level for the chunk。- 返回:
- the new ticket level for the chunk
-
getChunkHolder
返回 chunk that had its ticket level updated。- 返回:
- chunk that had its ticket level updated
-