mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-18 16:02:19 +01:00
Query complete player list for Scoreboard displays (Xstoudi)
This commit is contained in:
parent
b23736c72c
commit
109de51400
1 changed files with 3 additions and 4 deletions
|
@ -1,11 +1,8 @@
|
|||
package com.simibubi.create.content.logistics.block.display.source;
|
||||
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import com.simibubi.create.content.logistics.block.display.DisplayLinkContext;
|
||||
import com.simibubi.create.foundation.gui.ModularGuiLineBuilder;
|
||||
import com.simibubi.create.foundation.utility.IntAttached;
|
||||
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
|
@ -18,6 +15,8 @@ import net.minecraft.world.scores.criteria.ObjectiveCriteria.RenderType;
|
|||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public abstract class StatTrackingDisplaySource extends ScoreboardDisplaySource {
|
||||
|
||||
@Override
|
||||
|
@ -33,7 +32,7 @@ public abstract class StatTrackingDisplaySource extends ScoreboardDisplaySource
|
|||
scoreboard.addObjective(name, ObjectiveCriteria.DUMMY, getObjectiveDisplayName(), RenderType.INTEGER);
|
||||
Objective objective = scoreboard.getObjective(name);
|
||||
|
||||
sLevel.players()
|
||||
sLevel.getServer().getPlayerList().getPlayers()
|
||||
.forEach(s -> scoreboard.getOrCreatePlayerScore(s.getScoreboardName(), objective)
|
||||
.setScore(updatedScoreOf(s)));
|
||||
|
||||
|
|
Loading…
Reference in a new issue