use of net.minecraft.scoreboard.ServerScoreboard in project kull by Sxmurai.
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;
}
use of net.minecraft.scoreboard.ServerScoreboard in project UtilityClient2 by Utility-Client.
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;
}
use of net.minecraft.scoreboard.ServerScoreboard in project LoliServer by Loli-Server.
the class CraftScoreboardManager method getNewScoreboard.
@Override
public CraftScoreboard getNewScoreboard() {
CraftScoreboard scoreboard = new CraftScoreboard(new ServerScoreboard(server));
scoreboards.add(scoreboard);
return scoreboard;
}
use of net.minecraft.scoreboard.ServerScoreboard in project Magma by magmafoundation.
the class CraftScoreboardManager method setPlayerBoard.
// CraftBukkit method
public void setPlayerBoard(CraftPlayer player, org.bukkit.scoreboard.Scoreboard bukkitScoreboard) throws IllegalArgumentException {
Validate.isTrue(bukkitScoreboard instanceof CraftScoreboard, "Cannot set player scoreboard to an unregistered Scoreboard");
CraftScoreboard scoreboard = (CraftScoreboard) bukkitScoreboard;
Scoreboard oldboard = getPlayerBoard(player).getHandle();
Scoreboard newboard = scoreboard.getHandle();
EntityPlayerMP entityplayer = player.getHandle();
if (oldboard == newboard) {
return;
}
if (scoreboard == mainScoreboard) {
playerBoards.remove(player);
} else {
playerBoards.put(player, (CraftScoreboard) scoreboard);
}
// Old objective tracking
HashSet<ScoreObjective> removed = new HashSet<ScoreObjective>();
for (int i = 0; i < 3; ++i) {
ScoreObjective scoreboardobjective = oldboard.getObjectiveInDisplaySlot(i);
if (scoreboardobjective != null && !removed.contains(scoreboardobjective)) {
entityplayer.connection.sendPacket(new SPacketScoreboardObjective(scoreboardobjective, 1));
removed.add(scoreboardobjective);
}
}
// Old team tracking
Iterator<?> iterator = oldboard.getTeams().iterator();
while (iterator.hasNext()) {
ScorePlayerTeam scoreboardteam = (ScorePlayerTeam) iterator.next();
entityplayer.connection.sendPacket(new SPacketTeams(scoreboardteam, 1));
}
// The above is the reverse of the below method.
server.getPlayerList().sendScoreboard((ServerScoreboard) newboard, player.getHandle());
}
use of net.minecraft.scoreboard.ServerScoreboard in project Magma by magmafoundation.
the class CraftScoreboardManager method getNewScoreboard.
public CraftScoreboard getNewScoreboard() {
CraftScoreboard scoreboard = new CraftScoreboard(new ServerScoreboard(server));
scoreboards.add(scoreboard);
return scoreboard;
}
Aggregations