aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0596-Add-API-for-resetting-a-single-score.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0596-Add-API-for-resetting-a-single-score.patch')
-rw-r--r--patches/server/0596-Add-API-for-resetting-a-single-score.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/patches/server/0596-Add-API-for-resetting-a-single-score.patch b/patches/server/0596-Add-API-for-resetting-a-single-score.patch
new file mode 100644
index 0000000000..b9dd1c2be3
--- /dev/null
+++ b/patches/server/0596-Add-API-for-resetting-a-single-score.patch
@@ -0,0 +1,24 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: booky10 <[email protected]>
+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 29e24461e29e4cf3d31497198debcde18761ad73..ceb1a39c02c3cfa7632a0fdca414c7046888fcb1 100644
+--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java
++++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java
+@@ -66,4 +66,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.resetSinglePlayerScore(entry, this.objective.getHandle());
++ }
++ // Paper end
+ }