From 6d45da2babeb17f9edd04ce872386a1e496e6724 Mon Sep 17 00:00:00 2001 From: IzzelAliz Date: Wed, 15 Dec 2021 21:50:04 +0800 Subject: [PATCH] Digging packet DOS mitigation --- .../core/server/management/ServerPlayerGameModeMixin.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/server/management/ServerPlayerGameModeMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/server/management/ServerPlayerGameModeMixin.java index fb947799..132f94df 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/server/management/ServerPlayerGameModeMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/server/management/ServerPlayerGameModeMixin.java @@ -88,6 +88,9 @@ public abstract class ServerPlayerGameModeMixin implements PlayerInteractionMana */ @Overwrite public void handleBlockBreakAction(BlockPos blockPos, ServerboundPlayerActionPacket.Action action, Direction direction, int i) { + if (!this.level.hasChunkAt(blockPos)) { + return; + } double d0 = this.player.getX() - (blockPos.getX() + 0.5); double d2 = this.player.getY() - (blockPos.getY() + 0.5) + 1.5; double d3 = this.player.getZ() - (blockPos.getZ() + 0.5);