use of net.minecraft.world.storage.WorldSavedDataCallableSave in project CumServerPro by MCUmbrella.
the class WorldServer method init.
public World init() {
String s = VillageCollection.fileNameForProvider(this.provider);
VillageCollection villagecollection = (VillageCollection) this.perWorldStorage.getOrLoadData(VillageCollection.class, s);
if (villagecollection == null) {
this.villageCollection = new VillageCollection(this);
this.perWorldStorage.setData(s, this.villageCollection);
} else {
this.villageCollection = villagecollection;
this.villageCollection.setWorldsForAll(this);
}
if (getServer().getScoreboardManager() == null) {
// CraftBukkit
this.worldScoreboard = new ServerScoreboard(this.mcServer);
ScoreboardSaveData scoreboardsavedata = (ScoreboardSaveData) this.mapStorage.getOrLoadData(ScoreboardSaveData.class, "scoreboard");
if (scoreboardsavedata == null) {
scoreboardsavedata = new ScoreboardSaveData();
this.mapStorage.setData("scoreboard", scoreboardsavedata);
}
scoreboardsavedata.setScoreboard(this.worldScoreboard);
((ServerScoreboard) this.worldScoreboard).addDirtyRunnable(new WorldSavedDataCallableSave(scoreboardsavedata));
} else {
this.worldScoreboard = getServer().getScoreboardManager().getMainScoreboard().getHandle();
}
this.lootTable = new LootTableManager(new File(new File(this.saveHandler.getWorldDirectory(), "data"), "loot_tables"));
// CraftBukkit start
if (this.dimension != 0) {
// SPIGOT-3899 multiple worlds of advancements not supported
this.advancementManager = this.mcServer.getAdvancementManager();
}
if (this.advancementManager == null) {
this.advancementManager = new AdvancementManager(new File(new File(this.saveHandler.getWorldDirectory(), "data"), "advancements"));
}
// CraftBukkit end
this.functionManager = new FunctionManager(new File(new File(this.saveHandler.getWorldDirectory(), "data"), "functions"), this.mcServer);
this.getWorldBorder().setCenter(this.worldInfo.getBorderCenterX(), this.worldInfo.getBorderCenterZ());
this.getWorldBorder().setDamageAmount(this.worldInfo.getBorderDamagePerBlock());
this.getWorldBorder().setDamageBuffer(this.worldInfo.getBorderSafeZone());
this.getWorldBorder().setWarningDistance(this.worldInfo.getBorderWarningDistance());
this.getWorldBorder().setWarningTime(this.worldInfo.getBorderWarningTime());
if (this.worldInfo.getBorderLerpTime() > 0L) {
this.getWorldBorder().setTransition(this.worldInfo.getBorderSize(), this.worldInfo.getBorderLerpTarget(), this.worldInfo.getBorderLerpTime());
} else {
this.getWorldBorder().setTransition(this.worldInfo.getBorderSize());
}
this.initCapabilities();
this.initHopperThread(super.getHopperQueue());
return this;
}
use of net.minecraft.world.storage.WorldSavedDataCallableSave in project Minecraft-SlientClient-Hack by YouNeverKnow00.
the class WorldServer method init.
public World init() {
this.mapStorage = new MapStorage(this.saveHandler);
String s = VillageCollection.fileNameForProvider(this.provider);
VillageCollection villagecollection = (VillageCollection) this.mapStorage.getOrLoadData(VillageCollection.class, s);
if (villagecollection == null) {
this.villageCollectionObj = new VillageCollection(this);
this.mapStorage.setData(s, this.villageCollectionObj);
} else {
this.villageCollectionObj = villagecollection;
this.villageCollectionObj.setWorldsForAll(this);
}
this.worldScoreboard = new ServerScoreboard(this.mcServer);
ScoreboardSaveData scoreboardsavedata = (ScoreboardSaveData) this.mapStorage.getOrLoadData(ScoreboardSaveData.class, "scoreboard");
if (scoreboardsavedata == null) {
scoreboardsavedata = new ScoreboardSaveData();
this.mapStorage.setData("scoreboard", scoreboardsavedata);
}
scoreboardsavedata.setScoreboard(this.worldScoreboard);
((ServerScoreboard) this.worldScoreboard).addDirtyRunnable(new WorldSavedDataCallableSave(scoreboardsavedata));
this.lootTable = new LootTableManager(new File(new File(this.saveHandler.getWorldDirectory(), "data"), "loot_tables"));
this.field_191951_C = new AdvancementManager(new File(new File(this.saveHandler.getWorldDirectory(), "data"), "advancements"));
this.field_193036_D = new FunctionManager(new File(new File(this.saveHandler.getWorldDirectory(), "data"), "functions"), this.mcServer);
this.getWorldBorder().setCenter(this.worldInfo.getBorderCenterX(), this.worldInfo.getBorderCenterZ());
this.getWorldBorder().setDamageAmount(this.worldInfo.getBorderDamagePerBlock());
this.getWorldBorder().setDamageBuffer(this.worldInfo.getBorderSafeZone());
this.getWorldBorder().setWarningDistance(this.worldInfo.getBorderWarningDistance());
this.getWorldBorder().setWarningTime(this.worldInfo.getBorderWarningTime());
if (this.worldInfo.getBorderLerpTime() > 0L) {
this.getWorldBorder().setTransition(this.worldInfo.getBorderSize(), this.worldInfo.getBorderLerpTarget(), this.worldInfo.getBorderLerpTime());
} else {
this.getWorldBorder().setTransition(this.worldInfo.getBorderSize());
}
return this;
}
Aggregations