Search in sources :

Example 21 with MapStorage

use of net.minecraft.world.storage.MapStorage in project Tale-of-Kingdoms by Ivasik78.

the class WorldProvider method get.

public static WorldProvider get(World world) {
    MapStorage storage = world.mapStorage;
    WorldProvider instance = (WorldProvider) storage.loadData(WorldProvider.class, "tokWorld");
    if (instance == null) {
        instance = new WorldProvider("tokWorld");
        instance.markDirty();
        storage.setData("tokWorld", instance);
    }
    return instance;
}
Also used : MapStorage(net.minecraft.world.storage.MapStorage)

Example 22 with MapStorage

use of net.minecraft.world.storage.MapStorage in project Solar by ArekkuusuJerii.

the class WorldAlternatorData method get.

public static WorldAlternatorData get(World world) {
    MapStorage storage = world.getMapStorage();
    // noinspection ConstantConditions
    WorldAlternatorData data = (WorldAlternatorData) storage.getOrLoadData(WorldAlternatorData.class, NAME);
    if (data == null) {
        data = new WorldAlternatorData(NAME);
        storage.setData(NAME, data);
    }
    return data;
}
Also used : MapStorage(net.minecraft.world.storage.MapStorage)

Example 23 with MapStorage

use of net.minecraft.world.storage.MapStorage in project Solar by ArekkuusuJerii.

the class WorldQuantumData method get.

public static WorldQuantumData get(World world) {
    MapStorage storage = world.getMapStorage();
    // noinspection ConstantConditions
    WorldQuantumData data = (WorldQuantumData) storage.getOrLoadData(WorldQuantumData.class, NAME);
    if (data == null) {
        data = new WorldQuantumData(NAME);
        storage.setData(NAME, data);
    }
    return data;
}
Also used : MapStorage(net.minecraft.world.storage.MapStorage)

Example 24 with MapStorage

use of net.minecraft.world.storage.MapStorage in project Solar by ArekkuusuJerii.

the class WorldMonolithData method get.

@SuppressWarnings("ConstantConditions")
public static WorldMonolithData get(World world) {
    MapStorage storage = world.getMapStorage();
    WorldMonolithData data = (WorldMonolithData) storage.getOrLoadData(WorldMonolithData.class, NAME);
    if (data == null) {
        data = new WorldMonolithData(NAME);
        storage.setData(NAME, data);
    }
    return data;
}
Also used : MapStorage(net.minecraft.world.storage.MapStorage)

Example 25 with MapStorage

use of net.minecraft.world.storage.MapStorage in project TecTech by Technus.

the class EnderWorldSavedData method loadInstance.

private static void loadInstance() {
    if (INSTANCE == null) {
        MapStorage storage = DimensionManager.getWorld(0).mapStorage;
        INSTANCE = (EnderWorldSavedData) storage.loadData(EnderWorldSavedData.class, DATA_NAME);
        if (INSTANCE == null) {
            INSTANCE = new EnderWorldSavedData();
            storage.setData(DATA_NAME, INSTANCE);
        }
    }
    INSTANCE.markDirty();
}
Also used : MapStorage(net.minecraft.world.storage.MapStorage)

Aggregations

MapStorage (net.minecraft.world.storage.MapStorage)45 ScoreboardSaveData (net.minecraft.scoreboard.ScoreboardSaveData)5 ServerScoreboard (net.minecraft.scoreboard.ServerScoreboard)5 VillageCollection (net.minecraft.village.VillageCollection)5 AdvancementManager (net.minecraft.advancements.AdvancementManager)2 FunctionManager (net.minecraft.advancements.FunctionManager)2 WorldServer (net.minecraft.world.WorldServer)2 MapData (net.minecraft.world.storage.MapData)2 WorldSavedData (net.minecraft.world.storage.WorldSavedData)2 LootTableManager (net.minecraft.world.storage.loot.LootTableManager)2 DummyWorld (com.cleanroommc.multiblocked.util.world.DummyWorld)1 File (java.io.File)1 LinkedList (java.util.LinkedList)1 Nonnull (javax.annotation.Nonnull)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1 WorldSavedDataCallableSave (net.minecraft.world.storage.WorldSavedDataCallableSave)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1 NetworkData (sonar.flux.network.NetworkData)1