PaperMC/CraftBukkit-Patches/0075-Cap-Channel-Registrations.patch

22 lines
909 B
Diff
Raw Normal View History

2016-03-02 22:28:13 +01:00
From 8b992f8c14428b6cf9f074c284f561fdf6f8315b 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
2016-03-02 22:28:13 +01:00
index a725cf6..92e14d4 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
2016-03-02 22:28:13 +01:00
@@ -1054,6 +1054,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));
}
--
2016-02-29 22:33:06 +01:00
2.5.0