Search in sources :

Example 1 with LevelAccessor

use of net.minecraft.world.level.LevelAccessor in project MinecraftForge by MinecraftForge.

the class BlockSnapshot method getLevel.

@Nullable
public LevelAccessor getLevel() {
    LevelAccessor world = this.level != null ? this.level.get() : null;
    if (world == null) {
        world = ServerLifecycleHooks.getCurrentServer().getLevel(this.dim);
        this.level = new WeakReference<LevelAccessor>(world);
    }
    return world;
}
Also used : LevelAccessor(net.minecraft.world.level.LevelAccessor) Nullable(javax.annotation.Nullable)

Aggregations

Nullable (javax.annotation.Nullable)1 LevelAccessor (net.minecraft.world.level.LevelAccessor)1