Class WorldEventInstance
java.lang.Object
team.lodestar.lodestone.systems.worldevent.WorldEventInstance
World events are tickable instanced objects which are saved in a level capability, which means they are unique per dimension.
They can exist on the client and are ticked separately.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeserializeNBT(net.minecraft.nbt.CompoundTag tag) voidend(net.minecraft.world.level.Level level) net.minecraft.world.level.LevelgetLevel()booleanShould this event exist on the client? It will be automatically synced insync(Level)booleanisFrozen()If the event is frozen, it will not be ticked intick(Level)net.minecraft.nbt.CompoundTagserializeNBT(net.minecraft.nbt.CompoundTag tag) voidsetDirty()If the event is dirty, it will be synchronized to the client then set to not dirty.voidstart(net.minecraft.world.level.Level level) voidsync(net.minecraft.world.level.Level level) Syncs the world event to all players.static <T extends WorldEventInstance>
voidsync(T instance) static <T extends WorldEventInstance>
voidsync(T instance, net.minecraft.server.level.ServerPlayer player) net.minecraft.nbt.CompoundTagvoidtick(net.minecraft.world.level.Level level)
-
Field Details
-
uuid
-
type
-
level
public net.minecraft.world.level.Level level -
discarded
public boolean discarded -
dirty
public boolean dirty -
frozen
public boolean frozen
-
-
Constructor Details
-
WorldEventInstance
-
-
Method Details
-
sync
public void sync(net.minecraft.world.level.Level level) Syncs the world event to all players. -
isClientSynced
public boolean isClientSynced()Should this event exist on the client? It will be automatically synced insync(Level) -
start
public void start(net.minecraft.world.level.Level level) -
tick
public void tick(net.minecraft.world.level.Level level) -
end
public void end(net.minecraft.world.level.Level level) -
setDirty
public void setDirty()If the event is dirty, it will be synchronized to the client then set to not dirty. -
isFrozen
public boolean isFrozen()If the event is frozen, it will not be ticked intick(Level) -
getLevel
public net.minecraft.world.level.Level getLevel() -
serializeNBT
public net.minecraft.nbt.CompoundTag serializeNBT(net.minecraft.nbt.CompoundTag tag) -
deserializeNBT
-
synchronizeNBT
public net.minecraft.nbt.CompoundTag synchronizeNBT() -
sync
-
sync
public static <T extends WorldEventInstance> void sync(T instance, net.minecraft.server.level.ServerPlayer player)
-