Class WorldAttached<T>

java.lang.Object
com.jozufozu.flywheel.util.WorldAttached<T>

public class WorldAttached<T> extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    WorldAttached(Function<net.minecraft.world.level.LevelAccessor,T> factory)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    empty(BiConsumer<net.minecraft.world.level.LevelAccessor,T> finalizer)
    Deletes all entries after calling a function on them.
    void
    empty(Consumer<T> finalizer)
    Deletes all entries after calling a function on them.
    get(net.minecraft.world.level.LevelAccessor world)
     
    static void
    invalidateWorld(net.minecraft.world.level.LevelAccessor world)
     
    void
    put(net.minecraft.world.level.LevelAccessor world, T entry)
     
    replace(net.minecraft.world.level.LevelAccessor world)
    Replaces the entry with a new one from the factory and returns the new entry.
    replace(net.minecraft.world.level.LevelAccessor world, Consumer<T> finalizer)
    Replaces the entry with a new one from the factory and returns the new entry.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • WorldAttached

      public WorldAttached(Function<net.minecraft.world.level.LevelAccessor,T> factory)
  • Method Details

    • invalidateWorld

      public static void invalidateWorld(net.minecraft.world.level.LevelAccessor world)
    • get

      @Nonnull public T get(net.minecraft.world.level.LevelAccessor world)
    • put

      public void put(net.minecraft.world.level.LevelAccessor world, T entry)
    • replace

      @Nonnull public T replace(net.minecraft.world.level.LevelAccessor world)
      Replaces the entry with a new one from the factory and returns the new entry.
    • replace

      @Nonnull public T replace(net.minecraft.world.level.LevelAccessor world, Consumer<T> finalizer)
      Replaces the entry with a new one from the factory and returns the new entry.
    • empty

      public void empty(BiConsumer<net.minecraft.world.level.LevelAccessor,T> finalizer)
      Deletes all entries after calling a function on them.
      Parameters:
      finalizer - Do something with all of the world-value pairs
    • empty

      public void empty(Consumer<T> finalizer)
      Deletes all entries after calling a function on them.
      Parameters:
      finalizer - Do something with all of the values