2015-02-26 11:40:16 +01:00
|
|
|
From 70ec470642605e2766a71455fc95b5758e61e1c1 Mon Sep 17 00:00:00 2001
|
2014-07-21 22:46:54 +02:00
|
|
|
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
|
2015-02-26 11:40:16 +01:00
|
|
|
index 239ceca..5bd8cf9 100644
|
2014-07-21 22:46:54 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java
|
2015-01-17 00:12:14 +01:00
|
|
|
@@ -93,6 +93,7 @@ final class CraftObjective extends CraftScoreboardComponent implements Objective
|
2014-07-21 22:46:54 +02:00
|
|
|
|
|
|
|
public Score getScore(String entry) throws IllegalArgumentException, IllegalStateException {
|
|
|
|
Validate.notNull(entry, "Entry cannot be null");
|
2014-12-04 01:13:06 +01:00
|
|
|
+ if (entry.length() > 40) throw new IllegalArgumentException("Entry cannot be longer than 40 characters!"); // Spigot
|
2014-07-21 22:46:54 +02:00
|
|
|
CraftScoreboard scoreboard = checkState();
|
|
|
|
|
|
|
|
return new CraftScore(this, entry);
|
|
|
|
--
|
2014-11-28 02:17:45 +01:00
|
|
|
2.1.0
|
2014-07-21 22:46:54 +02:00
|
|
|
|