aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNassim Jahnke <[email protected]>2024-12-16 15:44:33 +0100
committerNassim Jahnke <[email protected]>2024-12-16 15:44:33 +0100
commit9c973e84bc1bd1d098ccd898d298866f8162f73f (patch)
treecbf54df0d6ded98d3a48a0c795d576c3b292563e
parent273ced9170293fbc0f39648b16a741e760856f93 (diff)
downloadPaper-9c973e84bc1bd1d098ccd898d298866f8162f73f.tar.gz
Paper-9c973e84bc1bd1d098ccd898d298866f8162f73f.zip
Some fixes
-rw-r--r--build-data/paper.at1
-rw-r--r--paper-server/patches/features/0006-Anti-Xray.patch26
-rw-r--r--paper-server/patches/features/0009-Optimize-GoalSelector-Goal.Flag-Set-operations.patch4
-rw-r--r--paper-server/patches/sources/net/minecraft/network/protocol/game/ClientboundLevelChunkWithLightPacket.java.patch14
4 files changed, 27 insertions, 18 deletions
diff --git a/build-data/paper.at b/build-data/paper.at
index 04c669edaa..3c12c9553d 100644
--- a/build-data/paper.at
+++ b/build-data/paper.at
@@ -101,6 +101,7 @@ public net.minecraft.server.level.ServerPlayer seenCredits
public net.minecraft.server.level.ServerPlayer triggerDimensionChangeTriggers(Lnet/minecraft/server/level/ServerLevel;)V
public net.minecraft.server.level.ServerPlayer wardenSpawnTracker
public net.minecraft.server.level.ServerPlayer$RespawnPosAngle
+public net.minecraft.server.level.ServerPlayerGameMode level
public net.minecraft.server.level.Ticket key
public net.minecraft.server.network.ServerGamePacketListenerImpl isChatMessageIllegal(Ljava/lang/String;)Z
public net.minecraft.server.network.ServerLoginPacketListenerImpl connection
diff --git a/paper-server/patches/features/0006-Anti-Xray.patch b/paper-server/patches/features/0006-Anti-Xray.patch
index 30ae5f9c6d..b322872f20 100644
--- a/paper-server/patches/features/0006-Anti-Xray.patch
+++ b/paper-server/patches/features/0006-Anti-Xray.patch
@@ -120,25 +120,28 @@ index 5d1943d37dfad0c12e77179f0866851532d983e9..3aea76690bc3e35758d3bf274777130a
}
diff --git a/net/minecraft/network/protocol/game/ClientboundLevelChunkWithLightPacket.java b/net/minecraft/network/protocol/game/ClientboundLevelChunkWithLightPacket.java
-index aadf2dccb996e422cacf8bb510cc642e69ee4972..d2d21fe8d7275b01454e09be252d7dd7710cdc2d 100644
+index 3a384175f8e7f204234bbaf3081bdc20c47a0d4b..5699bc15eba92e22433a20cb8326b59f2ebd3036 100644
--- a/net/minecraft/network/protocol/game/ClientboundLevelChunkWithLightPacket.java
+++ b/net/minecraft/network/protocol/game/ClientboundLevelChunkWithLightPacket.java
-@@ -18,13 +18,31 @@ public class ClientboundLevelChunkWithLightPacket implements Packet<ClientGamePa
+@@ -18,18 +18,31 @@ public class ClientboundLevelChunkWithLightPacket implements Packet<ClientGamePa
private final int z;
private final ClientboundLevelChunkPacketData chunkData;
private final ClientboundLightUpdatePacketData lightData;
+- // Paper start - Anti-Xray
+ // Paper start - Async-Anti-Xray - Ready flag for the connection, add chunk packet info
+ private volatile boolean ready;
-
++
+ @Override
+ public boolean isReady() {
+ return this.ready;
+ }
+
-+ public void setReady(boolean ready) {
+ public void setReady(final boolean ready) {
+- // Empty hook, updated by feature patch
+ this.ready = ready;
-+ }
-+
+ }
+- // Paper end - Anti-Xray
+
+ @Deprecated @io.papermc.paper.annotation.DoNotUse
public ClientboundLevelChunkWithLightPacket(LevelChunk chunk, LevelLightEngine lightEngine, @Nullable BitSet skyLight, @Nullable BitSet blockLight) {
+ this(chunk, lightEngine, skyLight, blockLight, true);
@@ -170,18 +173,9 @@ index a4b523ac1926895ccc87464892fa81753ae8f73c..ca9427a7eae9a66f4f1ccedda7b1def7
this.levelStorageAccess = levelStorageAccess;
this.uuid = org.bukkit.craftbukkit.util.WorldUUID.getUUID(levelStorageAccess.levelDirectory.path().toFile());
diff --git a/net/minecraft/server/level/ServerPlayerGameMode.java b/net/minecraft/server/level/ServerPlayerGameMode.java
-index d6a493de667bfe97b722efe40d1530bdb666bb94..bb352ad40da33a9d411836d4fab2664e226a6e38 100644
+index 732a4f20bade67c57a4f85142849752b72e349ee..6176f0738aa1a18df5d7d4d49fd6961e3f2eb736 100644
--- a/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/net/minecraft/server/level/ServerPlayerGameMode.java
-@@ -28,7 +28,7 @@ import org.slf4j.Logger;
-
- public class ServerPlayerGameMode {
- private static final Logger LOGGER = LogUtils.getLogger();
-- protected ServerLevel level;
-+ public ServerLevel level; // Paper - Anti-Xray - protected -> public
- protected final ServerPlayer player;
- private GameType gameModeForPlayer = GameType.DEFAULT_MODE;
- @Nullable
@@ -312,6 +312,7 @@ public class ServerPlayerGameMode {
org.bukkit.craftbukkit.event.CraftEventFactory.callBlockDamageAbortEvent(this.player, pos, this.player.getInventory().getSelected()); // CraftBukkit
}
diff --git a/paper-server/patches/features/0009-Optimize-GoalSelector-Goal.Flag-Set-operations.patch b/paper-server/patches/features/0009-Optimize-GoalSelector-Goal.Flag-Set-operations.patch
index 74942c0f7e..2c4bd4a04c 100644
--- a/paper-server/patches/features/0009-Optimize-GoalSelector-Goal.Flag-Set-operations.patch
+++ b/paper-server/patches/features/0009-Optimize-GoalSelector-Goal.Flag-Set-operations.patch
@@ -69,7 +69,7 @@ index e99836c4073d8b25eddd3b4c784dbdb1f0c4f2b1..a2d788a656b2a5767c8a00bbcaca16ef
// Paper end - Mob Goal API
diff --git a/net/minecraft/world/entity/ai/goal/GoalSelector.java b/net/minecraft/world/entity/ai/goal/GoalSelector.java
-index eeba224bd575451ba6023df65ef9d9b97f7f1c71..0846ad1f26ee73d72c77b53579a00c321d696b73 100644
+index eeba224bd575451ba6023df65ef9d9b97f7f1c71..20f0c1a444f40b28fe4de9ebc9eb40243c1f22a0 100644
--- a/net/minecraft/world/entity/ai/goal/GoalSelector.java
+++ b/net/minecraft/world/entity/ai/goal/GoalSelector.java
@@ -24,7 +24,8 @@ public class GoalSelector {
@@ -96,7 +96,7 @@ index eeba224bd575451ba6023df65ef9d9b97f7f1c71..0846ad1f26ee73d72c77b53579a00c32
- return false;
+ // Paper start - Perf: optimize goal types
+ private static boolean goalContainsAnyFlags(WrappedGoal goal, ca.spottedleaf.moonrise.common.set.OptimizedSmallEnumSet<Goal.Flag> flags) {
-+ return goal.getFlags().hasCommonElements(controls);
++ return goal.getFlags().hasCommonElements(flags);
}
private static boolean goalCanBeReplacedForAllFlags(WrappedGoal goal, Map<Goal.Flag, WrappedGoal> flag) {
diff --git a/paper-server/patches/sources/net/minecraft/network/protocol/game/ClientboundLevelChunkWithLightPacket.java.patch b/paper-server/patches/sources/net/minecraft/network/protocol/game/ClientboundLevelChunkWithLightPacket.java.patch
new file mode 100644
index 0000000000..edcd2a2d5d
--- /dev/null
+++ b/paper-server/patches/sources/net/minecraft/network/protocol/game/ClientboundLevelChunkWithLightPacket.java.patch
@@ -0,0 +1,14 @@
+--- a/net/minecraft/network/protocol/game/ClientboundLevelChunkWithLightPacket.java
++++ b/net/minecraft/network/protocol/game/ClientboundLevelChunkWithLightPacket.java
+@@ -18,6 +_,11 @@
+ private final int z;
+ private final ClientboundLevelChunkPacketData chunkData;
+ private final ClientboundLightUpdatePacketData lightData;
++ // Paper start - Anti-Xray
++ public void setReady(final boolean ready) {
++ // Empty hook, updated by feature patch
++ }
++ // Paper end - Anti-Xray
+
+ public ClientboundLevelChunkWithLightPacket(LevelChunk chunk, LevelLightEngine lightEngine, @Nullable BitSet skyLight, @Nullable BitSet blockLight) {
+ ChunkPos pos = chunk.getPos();