mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 04:02:50 +01:00
0cdce89d59
If a playerdata doesn't contain a valid, loaded world, reset to the main world spawn point
24 lines
1 KiB
Diff
24 lines
1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: booky10 <boooky10@gmail.com>
|
|
Date: Fri, 5 Nov 2021 21:01:36 +0100
|
|
Subject: [PATCH] Add API for resetting a single score
|
|
|
|
It was only possible to reset all scores for a specific entry, instead of resetting only specific scores.
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java
|
|
index 510f5ce6c4ea16b5ef5b6942311aa6f43b0083be..552a548d5fc72707a3ab56595c1586c0cf70e836 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java
|
|
@@ -68,4 +68,12 @@ final class CraftScore implements Score {
|
|
public CraftScoreboard getScoreboard() {
|
|
return this.objective.getScoreboard();
|
|
}
|
|
+
|
|
+ // Paper start
|
|
+ @Override
|
|
+ public void resetScore() {
|
|
+ Scoreboard board = this.objective.checkState().board;
|
|
+ board.resetPlayerScore(entry, this.objective.getHandle());
|
|
+ }
|
|
+ // Paper end
|
|
}
|