fix stuff and patch timmy exploit...
This commit is contained in:
parent
4d1a594cca
commit
93a8ffa2e0
1 changed files with 10 additions and 2 deletions
|
@ -6,6 +6,7 @@ import land.chipmunk.chipmunkmod.listeners.Listener;
|
||||||
import land.chipmunk.chipmunkmod.listeners.ListenerManager;
|
import land.chipmunk.chipmunkmod.listeners.ListenerManager;
|
||||||
import net.minecraft.network.listener.PacketListener;
|
import net.minecraft.network.listener.PacketListener;
|
||||||
import net.minecraft.network.packet.Packet;
|
import net.minecraft.network.packet.Packet;
|
||||||
|
import net.minecraft.network.packet.c2s.play.RequestCommandCompletionsC2SPacket;
|
||||||
import net.minecraft.network.packet.s2c.play.ParticleS2CPacket;
|
import net.minecraft.network.packet.s2c.play.ParticleS2CPacket;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
@ -47,8 +48,15 @@ public class ClientConnectionMixin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "send(Lnet/minecraft/network/packet/Packet;)V", at = @At("TAIL"))
|
@Inject(at = @At("HEAD"), method = "send(Lnet/minecraft/network/packet/Packet;)V", cancellable = true)
|
||||||
private static void sendPacket (Packet<?> packet, CallbackInfo ci) {
|
private void sendPacket (Packet<?> packet, CallbackInfo ci) {
|
||||||
|
if (packet instanceof RequestCommandCompletionsC2SPacket t_packet) {
|
||||||
|
if (t_packet.getPartialCommand().length() > 2048) {
|
||||||
|
ci.cancel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (Listener listener : ListenerManager.listeners) {
|
for (Listener listener : ListenerManager.listeners) {
|
||||||
listener.packetSent(packet);
|
listener.packetSent(packet);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue