From 88a347c75364d98f3470310c7cc8016df2858a9b Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Mon, 21 Jan 2019 20:48:27 +0000 Subject: [PATCH] Make force actually force a load While this posed no issues in testing, this is the only behavioral difference which might explain some increased reports in missing chunks on the client --- Spigot-Server-Patches/0338-Anti-Xray.patch | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Spigot-Server-Patches/0338-Anti-Xray.patch b/Spigot-Server-Patches/0338-Anti-Xray.patch index 1f580414fe4..e3e2a962c99 100644 --- a/Spigot-Server-Patches/0338-Anti-Xray.patch +++ b/Spigot-Server-Patches/0338-Anti-Xray.patch @@ -1,4 +1,4 @@ -From 353e49433fc2512d8f1296ca1775822f9e0bc372 Mon Sep 17 00:00:00 2001 +From d944e2981ec03a42be2deba04f02354a46df5331 Mon Sep 17 00:00:00 2001 From: stonar96 Date: Mon, 20 Aug 2018 03:03:58 +0200 Subject: [PATCH] Anti-Xray @@ -107,10 +107,10 @@ index 0000000000..1ba8477bf9 +} diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java new file mode 100644 -index 0000000000..904544b3c3 +index 0000000000..e3da35b6ba --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java -@@ -0,0 +1,678 @@ +@@ -0,0 +1,684 @@ +package com.destroystokyo.paper.antixray; + +import java.util.HashSet; @@ -267,12 +267,18 @@ index 0000000000..904544b3c3 + @Override + public boolean onChunkPacketCreate(Chunk chunk, int chunkSectionSelector, boolean force) { + //Load nearby chunks if necessary -+ if (chunkEdgeMode == ChunkEdgeMode.WAIT && !force) { ++ if (force) { ++ // if forced, load NOW; ++ chunk.world.getChunkAt(chunk.locX - 1, chunk.locZ); ++ chunk.world.getChunkAt(chunk.locX + 1, chunk.locZ); ++ chunk.world.getChunkAt(chunk.locX, chunk.locZ - 1); ++ chunk.world.getChunkAt(chunk.locX, chunk.locZ + 1); ++ } else if (chunkEdgeMode == ChunkEdgeMode.WAIT && !force) { + if (chunk.world.getChunkIfLoaded(chunk.locX - 1, chunk.locZ) == null || chunk.world.getChunkIfLoaded(chunk.locX + 1, chunk.locZ) == null || chunk.world.getChunkIfLoaded(chunk.locX, chunk.locZ - 1) == null || chunk.world.getChunkIfLoaded(chunk.locX, chunk.locZ + 1) == null) { + //Don't create the chunk packet now, wait until nearby chunks are loaded and create it later + return false; + } -+ } else if (chunkEdgeMode == ChunkEdgeMode.LOAD || chunkEdgeMode == ChunkEdgeMode.WAIT) { ++ } else if (chunkEdgeMode == ChunkEdgeMode.LOAD) { + boolean missingChunk = false; + //noinspection ConstantConditions + missingChunk |= ((WorldServer)chunk.world).getChunkProvider().getChunkAt(chunk.locX - 1, chunk.locZ, true, true, c -> {}) == null;