use of net.minecraft.world.storage.MapStorage in project wuxiacraft by airesnoronha.
the class WorldSectData method get.
public static WorldSectData get(World world) {
MapStorage storage = world.getMapStorage();
WorldSectData instance = (WorldSectData) storage.getOrLoadData(WorldSectData.class, DATA_NAME);
if (instance == null) {
instance = new WorldSectData();
storage.setData(DATA_NAME, instance);
}
return instance;
}
use of net.minecraft.world.storage.MapStorage in project wuxiacraft by airesnoronha.
the class WorldVariables method get.
public static WorldVariables get(World world) {
MapStorage storage = world.getPerWorldStorage();
WorldVariables instance = (WorldVariables) storage.getOrLoadData(WorldVariables.class, DATA_NAME);
if (instance == null) {
instance = new WorldVariables(world.provider.getDimension());
storage.setData(DATA_NAME, instance);
}
return instance;
}
use of net.minecraft.world.storage.MapStorage in project clientcommands by Earthcomputer.
the class ClientVirtualWorld method init.
@Override
public World init() {
mapStorage = new MapStorage(null);
String villageCollectionId = VillageCollection.fileNameForProvider(provider);
villageCollection = new VillageCollection(this);
mapStorage.setData(villageCollectionId, villageCollection);
worldScoreboard = new ServerScoreboard(server);
ScoreboardSaveData scoreboardSaveData = new ScoreboardSaveData();
mapStorage.setData("scoreboard", scoreboardSaveData);
scoreboardSaveData.setScoreboard(worldScoreboard);
lootTable = new LootTableManager(null);
advancementManager = new AdvancementManager(null);
functionManager = new FunctionManager(null, server);
getWorldBorder().setCenter(worldInfo.getBorderCenterX(), worldInfo.getBorderCenterZ());
getWorldBorder().setDamageAmount(worldInfo.getBorderDamagePerBlock());
getWorldBorder().setDamageBuffer(worldInfo.getBorderSafeZone());
getWorldBorder().setWarningDistance(worldInfo.getBorderWarningDistance());
getWorldBorder().setWarningTime(worldInfo.getBorderWarningTime());
if (worldInfo.getBorderLerpTime() > 0) {
getWorldBorder().setTransition(worldInfo.getBorderSize(), worldInfo.getBorderLerpTarget(), worldInfo.getBorderLerpTime());
} else {
getWorldBorder().setTransition(worldInfo.getBorderSize());
}
initCapabilities();
return this;
}
use of net.minecraft.world.storage.MapStorage in project GregTech by GregTechCEu.
the class VirtualTankRegistry method initializeStorage.
/**
* To be called on world load event
*/
public static void initializeStorage(World world) {
MapStorage storage = world.getMapStorage();
VirtualTankRegistry instance = (VirtualTankRegistry) storage.getOrLoadData(VirtualTankRegistry.class, DATA_ID);
if (instance == null) {
instance = new VirtualTankRegistry();
storage.setData(DATA_ID, instance);
}
}
use of net.minecraft.world.storage.MapStorage in project RuneCraftory by Flemmli97.
the class NPCVillageHandler method get.
public static NPCVillageHandler get(World world) {
MapStorage storage = world.getMapStorage();
NPCVillageHandler data = (NPCVillageHandler) storage.getOrLoadData(NPCVillageHandler.class, identifier);
if (data == null) {
data = new NPCVillageHandler();
storage.setData(identifier, data);
}
return data;
}
Aggregations