forked from stefatorus/LagAssist
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
741 B
27 lines
741 B
3 years ago
|
package com.entryrise.lagassist.packets;
|
||
|
|
||
|
import com.entryrise.lagassist.safety.SafetyAnticrash;
|
||
4 years ago
|
|
||
|
import io.netty.channel.Channel;
|
||
|
import io.netty.channel.ChannelDuplexHandler;
|
||
|
import io.netty.channel.ChannelHandlerContext;
|
||
|
|
||
|
/*
|
||
|
* Used for outright removal of packets from the moment the player was a bad boy.
|
||
|
*
|
||
|
* Makes sure to prevent other plugins (ProtocolLib) from being spammed with bad packets.
|
||
|
*/
|
||
|
public class BlacklistHandler extends ChannelDuplexHandler {
|
||
|
|
||
|
@Override
|
||
|
public void channelRead(ChannelHandlerContext ctx, Object arg1) throws Exception {
|
||
|
Channel ch = ctx.channel();
|
||
|
if (SafetyAnticrash.isDropped(ch)) {
|
||
|
ch.disconnect().get();
|
||
|
return;
|
||
|
}
|
||
|
super.channelRead(ctx, arg1);
|
||
|
}
|
||
|
|
||
|
}
|