Search in sources :

Example 16 with MapStorage

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

the class BlockPosToShipUUIDData method get.

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

Example 17 with MapStorage

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

the class ShipNameUUIDData method get.

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

Example 18 with MapStorage

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

the class WorldSavedDataVolumeBoxes method get.

public static WorldSavedDataVolumeBoxes get(World world) {
    if (world.isRemote) {
        throw new IllegalArgumentException("Tried to create a world saved data instance on the client!");
    }
    MapStorage storage = world.getPerWorldStorage();
    currentWorld = world;
    WorldSavedDataVolumeBoxes instance = (WorldSavedDataVolumeBoxes) storage.getOrLoadData(WorldSavedDataVolumeBoxes.class, DATA_NAME);
    if (instance == null) {
        instance = new WorldSavedDataVolumeBoxes();
        storage.setData(DATA_NAME, instance);
    }
    currentWorld = null;
    return instance;
}
Also used : MapStorage(net.minecraft.world.storage.MapStorage)

Example 19 with MapStorage

use of net.minecraft.world.storage.MapStorage in project Waystones by blay09.

the class NameGenerator method get.

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

Example 20 with MapStorage

use of net.minecraft.world.storage.MapStorage in project Waystones by blay09.

the class GlobalWaystones method get.

public static GlobalWaystones get(World world) {
    MapStorage storage = world.getMapStorage();
    if (storage != null) {
        GlobalWaystones instance = (GlobalWaystones) storage.getOrLoadData(GlobalWaystones.class, DATA_NAME);
        if (instance == null) {
            instance = new GlobalWaystones();
            storage.setData(DATA_NAME, instance);
        }
        return instance;
    }
    return new GlobalWaystones();
}
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