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;
}
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;
}
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;
}
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();
}
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();
}
Aggregations