Search in sources :

Example 1 with ServerScoreboard

use of net.minecraft.scoreboard.ServerScoreboard 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;
}
Also used : ServerScoreboard(net.minecraft.scoreboard.ServerScoreboard) AdvancementManager(net.minecraft.advancements.AdvancementManager) LootTableManager(net.minecraft.world.storage.loot.LootTableManager) ScoreboardSaveData(net.minecraft.scoreboard.ScoreboardSaveData) VillageCollection(net.minecraft.village.VillageCollection) MapStorage(net.minecraft.world.storage.MapStorage) FunctionManager(net.minecraft.advancements.FunctionManager)

Example 2 with ServerScoreboard

use of net.minecraft.scoreboard.ServerScoreboard in project Magma-1.16.x by magmafoundation.

the class CraftScoreboardManager method getNewScoreboard.

@Override
public CraftScoreboard getNewScoreboard() {
    // Spigot
    org.spigotmc.AsyncCatcher.catchOp("scoreboard creation");
    CraftScoreboard scoreboard = new CraftScoreboard(new ServerScoreboard(server));
    scoreboards.add(scoreboard);
    return scoreboard;
}
Also used : ServerScoreboard(net.minecraft.scoreboard.ServerScoreboard)

Example 3 with ServerScoreboard

use of net.minecraft.scoreboard.ServerScoreboard 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;
}
Also used : ServerScoreboard(net.minecraft.scoreboard.ServerScoreboard) AdvancementManager(net.minecraft.advancements.AdvancementManager) WorldSavedDataCallableSave(net.minecraft.world.storage.WorldSavedDataCallableSave) LootTableManager(net.minecraft.world.storage.loot.LootTableManager) ScoreboardSaveData(net.minecraft.scoreboard.ScoreboardSaveData) VillageCollection(net.minecraft.village.VillageCollection) File(java.io.File) FunctionManager(net.minecraft.advancements.FunctionManager)

Example 4 with ServerScoreboard

use of net.minecraft.scoreboard.ServerScoreboard 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;
}
Also used : ServerScoreboard(net.minecraft.scoreboard.ServerScoreboard) AdvancementManager(net.minecraft.advancements.AdvancementManager) WorldSavedDataCallableSave(net.minecraft.world.storage.WorldSavedDataCallableSave) LootTableManager(net.minecraft.world.storage.loot.LootTableManager) ScoreboardSaveData(net.minecraft.scoreboard.ScoreboardSaveData) VillageCollection(net.minecraft.village.VillageCollection) File(java.io.File) MapStorage(net.minecraft.world.storage.MapStorage) FunctionManager(net.minecraft.advancements.FunctionManager)

Example 5 with ServerScoreboard

use of net.minecraft.scoreboard.ServerScoreboard in project WizClient-1.8.9-Version by WizClient.

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.loadData(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.loadData(ScoreboardSaveData.class, "scoreboard");
    if (scoreboardsavedata == null) {
        scoreboardsavedata = new ScoreboardSaveData();
        this.mapStorage.setData("scoreboard", scoreboardsavedata);
    }
    scoreboardsavedata.setScoreboard(this.worldScoreboard);
    ((ServerScoreboard) this.worldScoreboard).func_96547_a(scoreboardsavedata);
    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;
}
Also used : ServerScoreboard(net.minecraft.scoreboard.ServerScoreboard) ScoreboardSaveData(net.minecraft.scoreboard.ScoreboardSaveData) VillageCollection(net.minecraft.village.VillageCollection) MapStorage(net.minecraft.world.storage.MapStorage)

Aggregations

ServerScoreboard (net.minecraft.scoreboard.ServerScoreboard)11 ScoreboardSaveData (net.minecraft.scoreboard.ScoreboardSaveData)6 VillageCollection (net.minecraft.village.VillageCollection)6 MapStorage (net.minecraft.world.storage.MapStorage)5 AdvancementManager (net.minecraft.advancements.AdvancementManager)3 FunctionManager (net.minecraft.advancements.FunctionManager)3 LootTableManager (net.minecraft.world.storage.loot.LootTableManager)3 File (java.io.File)2 WorldSavedDataCallableSave (net.minecraft.world.storage.WorldSavedDataCallableSave)2 HashSet (java.util.HashSet)1 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)1 SPacketScoreboardObjective (net.minecraft.network.play.server.SPacketScoreboardObjective)1 SPacketTeams (net.minecraft.network.play.server.SPacketTeams)1 ScoreObjective (net.minecraft.scoreboard.ScoreObjective)1 ScorePlayerTeam (net.minecraft.scoreboard.ScorePlayerTeam)1 Scoreboard (net.minecraft.scoreboard.Scoreboard)1