Java Code Examples for net.minecraft.world.World.getMapStorage()

The following are Jave code examples for showing how to use getMapStorage() of the net.minecraft.world.World class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: Randores2   File: RandoresWorldData.java   Source Code and License Vote up 5 votes
public static RandoresWorldData getSimply(World world) {
    MapStorage storage = world.getMapStorage();
    RandoresWorldData data = (RandoresWorldData) storage.getOrLoadData(RandoresWorldData.class, NAME);
    if (data == null) {
        data = new RandoresWorldData();
        data.setSeed(genSeed(world));
        storage.setData(NAME, data);
    }
    return data;
}
 
Example 2
Project: Solar   File: WorldMonolithData.java   Source Code and License Vote up 5 votes
@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;
}
 
Example 3
Project: Solar   File: WorldQuantumData.java   Source Code and License Vote up 5 votes
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;
}
 
Example 4
Project: modName   File: TileList.java   Source Code and License Vote up 5 votes
public static TileList get(World world)
{
	MapStorage storage = world.getMapStorage();
	TileList instance = (TileList)storage.getOrLoadData(TileList.class, DATA_NAME);
	TileList.world = world;
	
	if (instance == null)
	{
		System.out.println("It was null");
		instance = new TileList();
		storage.setData(DATA_NAME, instance);
	}
	
	return instance;
}
 
Example 5
Project: modName   File: WorldTurn.java   Source Code and License Vote up 5 votes
public static WorldTurn get(World world)
{
	MapStorage storage = world.getMapStorage();
	System.out.println(storage);
	WorldTurn instance = (WorldTurn)storage.getOrLoadData(WorldTurn.class, DATA_NAME);
	
	if (instance == null)
	{
		System.out.println("It was null");
		instance = new WorldTurn();
		storage.setData(DATA_NAME, instance);
	}
	
	return instance;
}
 
Example 6
Project: modName   File: EmpireList.java   Source Code and License Vote up 5 votes
public static EmpireList get(World world)
{
	EmpireList.world = world;
	MapStorage storage = world.getMapStorage();
	EmpireList instance = (EmpireList)storage.getOrLoadData(EmpireList.class, DATA_NAME);
	
	if (instance == null)
	{
		System.out.println("It was null");
		instance = new EmpireList();
		storage.setData(DATA_NAME, instance);
	}
	
	return instance;
}
 
Example 7
Project: CraftingParadiseMod   File: CraftingParadiseSaveData.java   Source Code and License Vote up 5 votes
public static CraftingParadiseSaveData get(World world)
{
    MapStorage storage = world.getMapStorage();
    CraftingParadiseSaveData instance = (CraftingParadiseSaveData) storage.getOrLoadData(CraftingParadiseSaveData.class, KEY);

    if(instance == null)
    {
        instance = new CraftingParadiseSaveData();
        storage.setData(KEY, instance);
    }

    return instance;
}
 
Example 8
Project: Randores2   File: RandoresWorldData.java   Source Code and License Vote up 4 votes
public static boolean hasData(World world) {
    MapStorage storage = world.getMapStorage();
    return storage.getOrLoadData(RandoresWorldData.class, NAME) != null;
}