Class WorldEventInstance

java.lang.Object
team.lodestar.lodestone.systems.worldevent.WorldEventInstance

public abstract class WorldEventInstance extends Object
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 Details

    • uuid

      public UUID uuid
    • type

      public WorldEventType type
    • level

      public net.minecraft.world.level.Level level
    • discarded

      public boolean discarded
    • dirty

      public boolean dirty
    • frozen

      public boolean frozen
  • Constructor Details

  • 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 in tick(Level)
    • getLevel

      public net.minecraft.world.level.Level getLevel()
    • serializeNBT

      @Internal public final net.minecraft.nbt.CompoundTag serializeNBT()
    • deserializeNBT

      @Internal public final WorldEventInstance deserializeNBT(net.minecraft.nbt.CompoundTag tag)
    • 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

      @Internal public static <T extends WorldEventInstance> void sync(T instance)
    • sync

      @Internal public static <T extends WorldEventInstance> void sync(T instance, @Nullable @Nullable net.minecraft.server.level.ServerPlayer player)