Search in sources :

Example 26 with MapStorage

use of net.minecraft.world.storage.MapStorage in project Kingdom-Keys-Re-Coded by Wehavecookies56.

the class WorldSavedDataKingdomKeys method get.

public static WorldSavedDataKingdomKeys get(World world) {
    MapStorage storage = world.getPerWorldStorage();
    WorldSavedDataKingdomKeys instance = (WorldSavedDataKingdomKeys) storage.getOrLoadData(WorldSavedDataKingdomKeys.class, DATA_NAME);
    if (instance == null) {
        instance = new WorldSavedDataKingdomKeys();
        storage.setData(DATA_NAME, instance);
    }
    return instance;
}
Also used : MapStorage(net.minecraft.world.storage.MapStorage)

Example 27 with MapStorage

use of net.minecraft.world.storage.MapStorage in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.

the class ChunkKeysWorldData method get.

public static ChunkKeysWorldData get(World world) {
    MapStorage storage = world.getPerWorldStorage();
    ChunkKeysWorldData data = (ChunkKeysWorldData) storage.getOrLoadData(ChunkKeysWorldData.class, key);
    if (data == null) {
        data = new ChunkKeysWorldData();
        world.setItemData(key, data);
    }
    return data;
}
Also used : MapStorage(net.minecraft.world.storage.MapStorage)

Example 28 with MapStorage

use of net.minecraft.world.storage.MapStorage in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.

the class ShipUUIDToPosData method get.

public static ShipUUIDToPosData get(World world) {
    MapStorage storage = world.getPerWorldStorage();
    ShipUUIDToPosData data = (ShipUUIDToPosData) storage.getOrLoadData(ShipUUIDToPosData.class, key);
    if (data == null) {
        data = new ShipUUIDToPosData();
        world.setItemData(key, data);
    }
    return data;
}
Also used : MapStorage(net.minecraft.world.storage.MapStorage)

Example 29 with MapStorage

use of net.minecraft.world.storage.MapStorage in project Railcraft by Railcraft.

the class BatterySaveData method forWorld.

public static BatterySaveData forWorld(World world) {
    MapStorage storage = world.getPerWorldStorage();
    BatterySaveData result = (BatterySaveData) storage.getOrLoadData(BatterySaveData.class, NAME);
    if (result == null) {
        result = new BatterySaveData(NAME);
        storage.setData(NAME, result);
    }
    return result;
}
Also used : MapStorage(net.minecraft.world.storage.MapStorage)

Example 30 with MapStorage

use of net.minecraft.world.storage.MapStorage in project BuildCraft by BuildCraft.

the class WorldSavedDataWireSystems method get.

public static WorldSavedDataWireSystems get(World world) {
    if (world.isRemote) {
        throw new UnsupportedOperationException("Attempted to get WorldSavedDataWireSystems on the client!");
    }
    MapStorage storage = world.getPerWorldStorage();
    WorldSavedDataWireSystems instance = (WorldSavedDataWireSystems) storage.getOrLoadData(WorldSavedDataWireSystems.class, DATA_NAME);
    if (instance == null) {
        instance = new WorldSavedDataWireSystems();
        storage.setData(DATA_NAME, instance);
    }
    instance.world = world;
    return instance;
}
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