Mojang caps chat to 100, we should too
This commit is contained in:
parent
56e9e6a245
commit
0f24eaeea3
@ -1,5 +1,6 @@
|
|||||||
package net.md_5.bungee.connection;
|
package net.md_5.bungee.connection;
|
||||||
|
|
||||||
|
import com.google.common.base.Preconditions;
|
||||||
import net.md_5.bungee.BungeeCord;
|
import net.md_5.bungee.BungeeCord;
|
||||||
import net.md_5.bungee.EntityMap;
|
import net.md_5.bungee.EntityMap;
|
||||||
import net.md_5.bungee.UserConnection;
|
import net.md_5.bungee.UserConnection;
|
||||||
@ -81,6 +82,8 @@ public class UpstreamBridge extends PacketHandler
|
|||||||
@Override
|
@Override
|
||||||
public void handle(Chat chat) throws Exception
|
public void handle(Chat chat) throws Exception
|
||||||
{
|
{
|
||||||
|
Preconditions.checkArgument( chat.getMessage().length() < 100, "Chat message too long" ); // Mojang limit, check on updates
|
||||||
|
|
||||||
ChatEvent chatEvent = new ChatEvent( con, con.getServer(), chat.getMessage() );
|
ChatEvent chatEvent = new ChatEvent( con, con.getServer(), chat.getMessage() );
|
||||||
if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() )
|
if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user