Skip to content

Commit

Permalink
fix anti packet kick
Browse files Browse the repository at this point in the history
  • Loading branch information
Wide-Cat committed Oct 28, 2023
1 parent 4c4b3ea commit 3a426d5
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,14 @@
import net.minecraft.nbt.NbtTagSizeTracker;
import net.minecraft.network.PacketByteBuf;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;

@Mixin(PacketByteBuf.class)
public class PacketByteBufMixin {
@Unique
private static final NbtTagSizeTracker EMPTY = new NbtTagSizeTracker(0L, 0);

@ModifyArg(method = "readNbt()Lnet/minecraft/nbt/NbtCompound;", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/PacketByteBuf;readNbt(Lnet/minecraft/nbt/NbtTagSizeTracker;)Lnet/minecraft/nbt/NbtElement;"))
private NbtTagSizeTracker xlPackets(NbtTagSizeTracker sizeTracker) {
return Modules.get().isActive(AntiPacketKick.class) ? EMPTY : sizeTracker;
return Modules.get().isActive(AntiPacketKick.class) ? NbtTagSizeTracker.ofUnlimitedBytes() : sizeTracker;
}
}

0 comments on commit 3a426d5

Please sign in to comment.