Fix book edit async kick
This commit is contained in:
parent
26f9fd0cb0
commit
89deb3d2ac
@ -199,7 +199,7 @@ public abstract class ServerPlayNetHandlerMixin implements ServerPlayNetHandlerB
|
|||||||
private int allowedPlayerTicks;
|
private int allowedPlayerTicks;
|
||||||
private int dropCount;
|
private int dropCount;
|
||||||
private int lastTick;
|
private int lastTick;
|
||||||
private int lastBookTick;
|
private volatile int lastBookTick;
|
||||||
private int lastDropTick;
|
private int lastDropTick;
|
||||||
|
|
||||||
private double lastPosX;
|
private double lastPosX;
|
||||||
@ -411,6 +411,7 @@ public abstract class ServerPlayNetHandlerMixin implements ServerPlayNetHandlerB
|
|||||||
@Inject(method = "processEditBook", cancellable = true, at = @At("HEAD"))
|
@Inject(method = "processEditBook", cancellable = true, at = @At("HEAD"))
|
||||||
private void arclight$editBookSpam(CEditBookPacket packetIn, CallbackInfo ci) {
|
private void arclight$editBookSpam(CEditBookPacket packetIn, CallbackInfo ci) {
|
||||||
if (this.lastBookTick + 20 > ArclightConstants.currentTick) {
|
if (this.lastBookTick + 20 > ArclightConstants.currentTick) {
|
||||||
|
PacketThreadUtil.checkThreadAndEnqueue(packetIn, (ServerPlayNetHandler) (Object) this, this.minecraftServer);
|
||||||
this.disconnect("Book edited too quickly!");
|
this.disconnect("Book edited too quickly!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user