Do not allow players to interact with entities outside the current region

This commit is contained in:
Spottedleaf 2023-03-11 05:38:11 -08:00
parent d2a5acba4a
commit 0fa5f339f2
2 changed files with 11 additions and 2 deletions

View File

@ -15746,7 +15746,7 @@ index abcc3266d18f34d160eac87fdea153dce24c60b8..7cf0619883577a0f21ed75ba70ece90d
Collections.shuffle( this.connections );
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 3472f7f9b98d6d9c9f6465872803ef17fa67486d..eb717d86deeebda89b5bcbbfce1755dd10420da9 100644
index 3472f7f9b98d6d9c9f6465872803ef17fa67486d..19b7bcb7a773d48580842cbd33e022c57f08f019 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -320,10 +320,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@ -16093,6 +16093,15 @@ index 3472f7f9b98d6d9c9f6465872803ef17fa67486d..eb717d86deeebda89b5bcbbfce1755dd
final String conversationInput = s;
this.server.processQueue.add(new Runnable() {
@Override
@@ -2751,7 +2770,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.player.resetLastActionTime();
this.player.setShiftKeyDown(packet.isUsingSecondaryAction());
- if (entity != null) {
+ if (io.papermc.paper.util.TickThread.isTickThreadFor(entity) && entity != null) { // Folia - region threading - do not allow interaction of entities outside the current region
if (!worldserver.getWorldBorder().isWithinBounds(entity.blockPosition())) {
return;
}
@@ -2889,6 +2908,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
switch (packetplayinclientcommand_enumclientcommand) {
case PERFORM_RESPAWN:

View File

@ -38,7 +38,7 @@ index 22f06033a731c3ba1b815842be7a9d575fa820f2..93262f2ade2e9f70377bbf9acfe1a02e
PlaceCommand.register(this.dispatcher);
PlaySoundCommand.register(this.dispatcher);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index eb717d86deeebda89b5bcbbfce1755dd10420da9..372b043c613d5071ad8cc1381826a40b7ae41bda 100644
index 19b7bcb7a773d48580842cbd33e022c57f08f019..5f01b0c09df6ebcb32e076581e33075835deda35 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2222,7 +2222,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic