Paper/CraftBukkit-Patches/0086-Cap-Channel-Registrations.patch

22 Zeilen
909 B
Diff

2015-02-26 11:40:16 +01:00
From d948ca461b0bdfe0a46c85c2a8c83b2156f00c61 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Wed, 12 Feb 2014 20:02:58 +1100
Subject: [PATCH] Cap Channel Registrations
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
2015-02-26 11:40:16 +01:00
index fd0c2d2..c6caeec 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1061,6 +1061,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public void addChannel(String channel) {
2014-11-28 02:17:45 +01:00
+ com.google.common.base.Preconditions.checkState( channels.size() < 128, "Too many channels registered" ); // Spigot
if (channels.add(channel)) {
server.getPluginManager().callEvent(new PlayerRegisterChannelEvent(this, channel));
}
--
2014-11-28 02:17:45 +01:00
2.1.0