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.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidaddAdditionalSaveData(net.minecraft.nbt.CompoundTag tag) Adds additional data during serialization.final WorldEventInstancedeserializeNBT(net.minecraft.nbt.CompoundTag tag) voidend(net.minecraft.world.level.Level level) net.minecraft.world.level.LevelgetLevel()booleanisFrozen()If the event is frozen, it will not be ticked intick(Level)protected abstract voidreadAdditionalSaveData(net.minecraft.nbt.CompoundTag tag) Reads additional data during deserialization.final net.minecraft.nbt.CompoundTagvoidsetDirty()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) static <T extends WorldEventInstance>
voidsync(T instance) static <T extends WorldEventInstance>
voidsync(T instance, @Nullable net.minecraft.server.level.ServerPlayer player) net.minecraft.nbt.CompoundTagabstract voidtick(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
-
tick
public abstract void tick(net.minecraft.world.level.Level level) -
addAdditionalSaveData
protected abstract void addAdditionalSaveData(net.minecraft.nbt.CompoundTag tag) Adds additional data during serialization. This method should be overridden to save custom fields.- Parameters:
tag- the CompoundTag to add the additional data to
-
readAdditionalSaveData
protected abstract void readAdditionalSaveData(net.minecraft.nbt.CompoundTag tag) Reads additional data during deserialization. This method should be overridden to load custom fields.- Parameters:
tag- the CompoundTag to read the additional data from
-
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
@Internal public final net.minecraft.nbt.CompoundTag serializeNBT() -
deserializeNBT
-
sync
@Internal public void sync(net.minecraft.world.level.Level level) -
start
@Internal public void start(net.minecraft.world.level.Level level) -
synchronizeNBT
@Internal public net.minecraft.nbt.CompoundTag synchronizeNBT() -
sync
-
sync
@Internal public static <T extends WorldEventInstance> void sync(T instance, @Nullable @Nullable net.minecraft.server.level.ServerPlayer player)
-