From 4d3af9c19bfb1f9a02b19c968b22e5ef6d271a14 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 3 Mar 2016 16:38:57 +1100 Subject: [PATCH] SPIGOT-1677: Fix attributes with only single underscore. --- .../org/bukkit/craftbukkit/attribute/CraftAttributeMap.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeMap.java b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeMap.java index 0412470b3d..7c94acc5dd 100644 --- a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeMap.java +++ b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeMap.java @@ -29,8 +29,10 @@ public class CraftAttributeMap implements Attributable { StringBuilder sb = new StringBuilder(bukkit.toLowerCase()); sb.setCharAt(first, '.'); - sb.deleteCharAt(second); - sb.setCharAt(second, bukkit.charAt(second + 1)); + if (second != -1) { + sb.deleteCharAt(second); + sb.setCharAt(second, bukkit.charAt(second + 1)); + } return sb.toString(); }