Paper/patches/server/0661-Add-API-for-resetting-a-single-score.patch
Jake Potrebic 1e7dd72f15
Remove 'fix Vanilla Minecart speed' patch (#10068)
The game uses 0.95d now
2023-12-22 17:44:36 -08:00

25 lines
1.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 a7f53c135bae2a464e7cd28bf8e990d692c63d63..be020d6b686c1ad5bd8b7cee0b6050304d434022 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.resetSinglePlayerScore(entry, this.objective.getHandle());
+ }
+ // Paper end
}