mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
b742f7a892
Upstream merge (we must go deeper) SpigotMC/Spigot@1e7bc383c3
20 lines
No EOL
1.1 KiB
Diff
20 lines
No EOL
1.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: hauno <imhauno@gmail.com>
|
|
Date: Tue, 6 May 2014 18:01:37 -0700
|
|
Subject: [PATCH] Cap Objective Score Length
|
|
|
|
Adds a check for Score arguments that would crash the client
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java
|
|
@@ -0,0 +0,0 @@ final class CraftObjective extends CraftScoreboardComponent implements Objective
|
|
|
|
public Score getScore(String entry) throws IllegalArgumentException, IllegalStateException {
|
|
Validate.notNull(entry, "Entry cannot be null");
|
|
+ if (entry.length() > 16) throw new IllegalArgumentException("Entry cannot be longer than 16 characters!"); // Spigot
|
|
CraftScoreboard scoreboard = checkState();
|
|
|
|
return new CraftScore(this, entry);
|
|
--
|