2014-08-18 15:43:17 +00:00
|
|
|
From c74bd3384bf81012a0eb121ec2f27b047e1c0b77 Mon Sep 17 00:00:00 2001
|
2014-07-21 20:46:54 +00: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
|
|
|
|
index 9eaec71..0ee1147 100644
|
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java
|
|
|
|
@@ -95,6 +95,7 @@ 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);
|
|
|
|
--
|
|
|
|
1.9.1
|
|
|
|
|