From b0212308376936e3e95196fddb8bd455b5cc9da9 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 5 Jan 2019 16:21:07 +1100 Subject: [PATCH] Cap Channel Registrations --- src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 6613599a3f..d2bb043e99 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1209,6 +1209,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void addChannel(String channel) { + Preconditions.checkState(channels.size() < 128, "Cannot register channel '%s'. Too many channels registered!", channel); channel = StandardMessenger.validateAndCorrectChannel(channel); if (channels.add(channel)) { server.getPluginManager().callEvent(new PlayerRegisterChannelEvent(this, channel));