3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 04:20:04 +01:00

Fix custom world height in xray patch

Dieser Commit ist enthalten in:
KennyTV 2021-06-16 15:14:19 +02:00
Ursprung 2b8d06aed3
Commit 2b3c483a98
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
13 geänderte Dateien mit 96 neuen und 92 gelöschten Zeilen

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Anti-Xray
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index a91a7d8f56a068b18d50a8b987b71510b0a19d5b..c1bf19629cca9a6b616a63ae7a919827ec839c12 100644 index a91a7d8f56a068b18d50a8b987b71510b0a19d5b..b8ca1f73b2451307c3711076eaa43e2adb34d92e 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -1,7 +1,9 @@ @@ -1,7 +1,9 @@
@ -18,14 +18,14 @@ index a91a7d8f56a068b18d50a8b987b71510b0a19d5b..c1bf19629cca9a6b616a63ae7a919827
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;
import org.spigotmc.SpigotWorldConfig; import org.spigotmc.SpigotWorldConfig;
@@ -484,5 +486,41 @@ public class PaperWorldConfig { @@ -484,5 +486,40 @@ public class PaperWorldConfig {
private void lightQueueSize() { private void lightQueueSize() {
lightQueueSize = getInt("light-queue-size", lightQueueSize); lightQueueSize = getInt("light-queue-size", lightQueueSize);
} }
+ +
+ public boolean antiXray; + public boolean antiXray;
+ public EngineMode engineMode; + public EngineMode engineMode;
+ public int maxChunkSectionIndex; + public int maxBlockHeight;
+ public int updateRadius; + public int updateRadius;
+ public boolean lavaObscures; + public boolean lavaObscures;
+ public boolean usePermission; + public boolean usePermission;
@ -35,8 +35,7 @@ index a91a7d8f56a068b18d50a8b987b71510b0a19d5b..c1bf19629cca9a6b616a63ae7a919827
+ antiXray = getBoolean("anti-xray.enabled", false); + antiXray = getBoolean("anti-xray.enabled", false);
+ engineMode = EngineMode.getById(getInt("anti-xray.engine-mode", EngineMode.HIDE.getId())); + engineMode = EngineMode.getById(getInt("anti-xray.engine-mode", EngineMode.HIDE.getId()));
+ engineMode = engineMode == null ? EngineMode.HIDE : engineMode; + engineMode = engineMode == null ? EngineMode.HIDE : engineMode;
+ maxChunkSectionIndex = getInt("anti-xray.max-chunk-section-index", 3); + maxBlockHeight = getInt("anti-xray.max-block-height", 64);
+ maxChunkSectionIndex = maxChunkSectionIndex > 15 ? 15 : maxChunkSectionIndex;
+ updateRadius = getInt("anti-xray.update-radius", 2); + updateRadius = getInt("anti-xray.update-radius", 2);
+ lavaObscures = getBoolean("anti-xray.lava-obscures", false); + lavaObscures = getBoolean("anti-xray.lava-obscures", false);
+ usePermission = getBoolean("anti-xray.use-permission", false); + usePermission = getBoolean("anti-xray.use-permission", false);
@ -53,7 +52,7 @@ index a91a7d8f56a068b18d50a8b987b71510b0a19d5b..c1bf19629cca9a6b616a63ae7a919827
+ set("anti-xray.hidden-blocks", hiddenBlocks); + set("anti-xray.hidden-blocks", hiddenBlocks);
+ set("anti-xray.replacement-blocks", replacementBlocks); + set("anti-xray.replacement-blocks", replacementBlocks);
+ } + }
+ log("Anti-Xray: " + (antiXray ? "enabled" : "disabled") + " / Engine Mode: " + engineMode.getDescription() + " / Up to " + ((maxChunkSectionIndex + 1) * 16) + " blocks / Update Radius: " + updateRadius); + log("Anti-Xray: " + (antiXray ? "enabled" : "disabled") + " / Engine Mode: " + engineMode.getDescription() + " / Up to " + ((maxBlockHeight >> 4) << 4) + " blocks / Update Radius: " + updateRadius);
+ if (antiXray && usePermission) { + if (antiXray && usePermission) {
+ Bukkit.getLogger().warning("You have enabled permission-based Anti-Xray checking - depending on your permission plugin, this may cause performance issues"); + Bukkit.getLogger().warning("You have enabled permission-based Anti-Xray checking - depending on your permission plugin, this may cause performance issues");
+ } + }
@ -62,7 +61,7 @@ index a91a7d8f56a068b18d50a8b987b71510b0a19d5b..c1bf19629cca9a6b616a63ae7a919827
diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockController.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockController.java diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockController.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockController.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..95d16cd708817534e5f2748f5da9c98c835392be index 0000000000000000000000000000000000000000..55e1c448999d79ddd9781d6f8ff2899807802146
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockController.java +++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockController.java
@@ -0,0 +1,45 @@ @@ -0,0 +1,45 @@
@ -95,12 +94,12 @@ index 0000000000000000000000000000000000000000..95d16cd708817534e5f2748f5da9c98c
+ return false; + return false;
+ } + }
+ +
+ public ChunkPacketInfo<BlockState> getChunkPacketInfo(ClientboundLevelChunkPacket packetPlayOutMapChunk, LevelChunk chunk) { + public ChunkPacketInfo<BlockState> getChunkPacketInfo(ClientboundLevelChunkPacket chunkPacket, LevelChunk chunk) {
+ return null; + return null;
+ } + }
+ +
+ public void modifyBlocks(ClientboundLevelChunkPacket packetPlayOutMapChunk, ChunkPacketInfo<BlockState> chunkPacketInfo) { + public void modifyBlocks(ClientboundLevelChunkPacket chunkPacket, ChunkPacketInfo<BlockState> chunkPacketInfo) {
+ packetPlayOutMapChunk.setReady(true); + chunkPacket.setReady(true);
+ } + }
+ +
+ public void onBlockChange(Level world, BlockPos blockPosition, BlockState newBlockData, BlockState oldBlockData, int flag) { + public void onBlockChange(Level world, BlockPos blockPosition, BlockState newBlockData, BlockState oldBlockData, int flag) {
@ -113,10 +112,10 @@ index 0000000000000000000000000000000000000000..95d16cd708817534e5f2748f5da9c98c
+} +}
diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java 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 new file mode 100644
index 0000000000000000000000000000000000000000..db95bde2a0bb17d13d0588dd0bbb81b7c5506345 index 0000000000000000000000000000000000000000..f13651f8ede36b3324d0bd87a51368ecb724f4e6
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java +++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
@@ -0,0 +1,649 @@ @@ -0,0 +1,646 @@
+package com.destroystokyo.paper.antixray; +package com.destroystokyo.paper.antixray;
+ +
+import java.util.ArrayList; +import java.util.ArrayList;
@ -155,6 +154,7 @@ index 0000000000000000000000000000000000000000..db95bde2a0bb17d13d0588dd0bbb81b7
+ +
+ private final Executor executor; + private final Executor executor;
+ private final EngineMode engineMode; + private final EngineMode engineMode;
+ private final int worldSectionHeight;
+ private final int maxChunkSectionIndex; + private final int maxChunkSectionIndex;
+ private final int updateRadius; + private final int updateRadius;
+ private final boolean usePermission; + private final boolean usePermission;
@ -175,7 +175,10 @@ index 0000000000000000000000000000000000000000..db95bde2a0bb17d13d0588dd0bbb81b7
+ public ChunkPacketBlockControllerAntiXray(Level world, Executor executor) { + public ChunkPacketBlockControllerAntiXray(Level world, Executor executor) {
+ PaperWorldConfig paperWorldConfig = world.paperConfig; + PaperWorldConfig paperWorldConfig = world.paperConfig;
+ engineMode = paperWorldConfig.engineMode; + engineMode = paperWorldConfig.engineMode;
+ maxChunkSectionIndex = paperWorldConfig.maxChunkSectionIndex; +
+ int minSection = world.getMinSection();
+ worldSectionHeight = world.getSectionsCount();
+ maxChunkSectionIndex = (paperWorldConfig.maxBlockHeight >> 4) - minSection;
+ updateRadius = paperWorldConfig.updateRadius; + updateRadius = paperWorldConfig.updateRadius;
+ usePermission = paperWorldConfig.usePermission; + usePermission = paperWorldConfig.usePermission;
+ +
@ -208,11 +211,10 @@ index 0000000000000000000000000000000000000000..db95bde2a0bb17d13d0588dd0bbb81b7
+ } + }
+ +
+ // The doc of the LinkedHashSet(Collection<? extends E> c) constructor doesn't specify that the insertion order is the predictable iteration order of the specified Collection, although it is in the implementation + // The doc of the LinkedHashSet(Collection<? extends E> c) constructor doesn't specify that the insertion order is the predictable iteration order of the specified Collection, although it is in the implementation
+ Set<BlockState> predefinedBlockDataSet = new LinkedHashSet<BlockState>(); + Set<BlockState> predefinedBlockDataSet = new LinkedHashSet<>(predefinedBlockDataList);
+ // Therefore addAll(Collection<? extends E> c) is used, which guarantees this order in the doc + // Therefore addAll(Collection<? extends E> c) is used, which guarantees this order in the doc
+ predefinedBlockDataSet.addAll(predefinedBlockDataList); + predefinedBlockData = predefinedBlockDataSet.isEmpty() ? new BlockState[] {Blocks.DIAMOND_ORE.defaultBlockState()} : predefinedBlockDataSet.toArray(new BlockState[0]);
+ predefinedBlockData = predefinedBlockDataSet.size() == 0 ? new BlockState[] {Blocks.DIAMOND_ORE.defaultBlockState()} : predefinedBlockDataSet.toArray(new BlockState[0]); + predefinedBlockDataFull = predefinedBlockDataSet.isEmpty() ? new BlockState[] {Blocks.DIAMOND_ORE.defaultBlockState()} : predefinedBlockDataList.toArray(new BlockState[0]);
+ predefinedBlockDataFull = predefinedBlockDataSet.size() == 0 ? new BlockState[] {Blocks.DIAMOND_ORE.defaultBlockState()} : predefinedBlockDataList.toArray(new BlockState[0]);
+ predefinedBlockDataStone = null; + predefinedBlockDataStone = null;
+ predefinedBlockDataNetherrack = null; + predefinedBlockDataNetherrack = null;
+ predefinedBlockDataEndStone = null; + predefinedBlockDataEndStone = null;
@ -266,19 +268,14 @@ index 0000000000000000000000000000000000000000..db95bde2a0bb17d13d0588dd0bbb81b7
+ public BlockState[] getPredefinedBlockData(Level world, ChunkAccess chunk, LevelChunkSection chunkSection, boolean initializeBlocks) { + public BlockState[] getPredefinedBlockData(Level world, ChunkAccess chunk, LevelChunkSection chunkSection, boolean initializeBlocks) {
+ // Return the block data which should be added to the data palettes so that they can be used for the obfuscation + // Return the block data which should be added to the data palettes so that they can be used for the obfuscation
+ if (chunkSection.bottomBlockY() >> 4 <= maxChunkSectionIndex) { + if (chunkSection.bottomBlockY() >> 4 <= maxChunkSectionIndex) {
+ switch (engineMode) { + if (engineMode == EngineMode.HIDE) {
+ case HIDE: + return switch (world.getWorld().getEnvironment()) {
+ switch (world.getWorld().getEnvironment()) { + case NETHER -> predefinedBlockDataNetherrack;
+ case NETHER: + case THE_END -> predefinedBlockDataEndStone;
+ return predefinedBlockDataNetherrack; + default -> predefinedBlockDataStone;
+ case THE_END: + };
+ return predefinedBlockDataEndStone;
+ default:
+ return predefinedBlockDataStone;
+ }
+ default:
+ return predefinedBlockData;
+ } + }
+ return predefinedBlockData;
+ } + }
+ +
+ return null; + return null;
@ -290,24 +287,23 @@ index 0000000000000000000000000000000000000000..db95bde2a0bb17d13d0588dd0bbb81b7
+ } + }
+ +
+ @Override + @Override
+ public ChunkPacketInfoAntiXray getChunkPacketInfo(ClientboundLevelChunkPacket packetPlayOutMapChunk, LevelChunk chunk) { + public ChunkPacketInfoAntiXray getChunkPacketInfo(ClientboundLevelChunkPacket chunkPacket, LevelChunk chunk) {
+ // Return a new instance to collect data and objects in the right state while creating the chunk packet for thread safe access later + // Return a new instance to collect data and objects in the right state while creating the chunk packet for thread safe access later
+ // Note: As of 1.14 this has to be moved later due to the chunk system. + // Note: As of 1.14 this has to be moved later due to the chunk system.
+ ChunkPacketInfoAntiXray chunkPacketInfoAntiXray = new ChunkPacketInfoAntiXray(packetPlayOutMapChunk, chunk, this); + return new ChunkPacketInfoAntiXray(chunkPacket, chunk, this);
+ return chunkPacketInfoAntiXray;
+ } + }
+ +
+ @Override + @Override
+ public void modifyBlocks(ClientboundLevelChunkPacket packetPlayOutMapChunk, ChunkPacketInfo<BlockState> chunkPacketInfo) { + public void modifyBlocks(ClientboundLevelChunkPacket chunkPacket, ChunkPacketInfo<BlockState> chunkPacketInfo) {
+ if (chunkPacketInfo == null) { + if (chunkPacketInfo == null) {
+ packetPlayOutMapChunk.setReady(true); + chunkPacket.setReady(true);
+ return; + return;
+ } + }
+ +
+ if (!Bukkit.isPrimaryThread()) { + if (!Bukkit.isPrimaryThread()) {
+ // plugins? + // plugins?
+ MinecraftServer.getServer().scheduleOnMain(() -> { + MinecraftServer.getServer().scheduleOnMain(() -> {
+ this.modifyBlocks(packetPlayOutMapChunk, chunkPacketInfo); + this.modifyBlocks(chunkPacket, chunkPacketInfo);
+ }); + });
+ return; + return;
+ } + }
@ -315,7 +311,7 @@ index 0000000000000000000000000000000000000000..db95bde2a0bb17d13d0588dd0bbb81b7
+ LevelChunk chunk = chunkPacketInfo.getChunk(); + LevelChunk chunk = chunkPacketInfo.getChunk();
+ int x = chunk.getPos().x; + int x = chunk.getPos().x;
+ int z = chunk.getPos().z; + int z = chunk.getPos().z;
+ ServerLevel world = (ServerLevel)chunk.level; + ServerLevel world = chunk.level;
+ ((ChunkPacketInfoAntiXray) chunkPacketInfo).setNearbyChunks( + ((ChunkPacketInfoAntiXray) chunkPacketInfo).setNearbyChunks(
+ (LevelChunk) world.getChunkIfLoadedImmediately(x - 1, z), + (LevelChunk) world.getChunkIfLoadedImmediately(x - 1, z),
+ (LevelChunk) world.getChunkIfLoadedImmediately(x + 1, z), + (LevelChunk) world.getChunkIfLoadedImmediately(x + 1, z),
@ -337,11 +333,11 @@ index 0000000000000000000000000000000000000000..db95bde2a0bb17d13d0588dd0bbb81b7
+ +
+ public void obfuscate(ChunkPacketInfoAntiXray chunkPacketInfoAntiXray) { + public void obfuscate(ChunkPacketInfoAntiXray chunkPacketInfoAntiXray) {
+ int[] predefinedBlockDataBits = this.predefinedBlockDataBits.get(); + int[] predefinedBlockDataBits = this.predefinedBlockDataBits.get();
+ boolean[] solid = this.solid.get(); + boolean[] solid = ChunkPacketBlockControllerAntiXray.solid.get();
+ boolean[] obfuscate = this.obfuscate.get(); + boolean[] obfuscate = ChunkPacketBlockControllerAntiXray.obfuscate.get();
+ boolean[][] current = this.current.get(); + boolean[][] current = ChunkPacketBlockControllerAntiXray.current.get();
+ boolean[][] next = this.next.get(); + boolean[][] next = ChunkPacketBlockControllerAntiXray.next.get();
+ boolean[][] nextNext = this.nextNext.get(); + boolean[][] nextNext = ChunkPacketBlockControllerAntiXray.nextNext.get();
+ // dataBitsReader, dataBitsWriter and nearbyChunkSections could also be reused (with ThreadLocal if necessary) but it's not worth it + // dataBitsReader, dataBitsWriter and nearbyChunkSections could also be reused (with ThreadLocal if necessary) but it's not worth it
+ DataBitsReader dataBitsReader = new DataBitsReader(); + DataBitsReader dataBitsReader = new DataBitsReader();
+ DataBitsWriter dataBitsWriter = new DataBitsWriter(); + DataBitsWriter dataBitsWriter = new DataBitsWriter();
@ -431,7 +427,7 @@ index 0000000000000000000000000000000000000000..db95bde2a0bb17d13d0588dd0bbb81b7
+ // If so, obfuscate the upper layer of the current chunk section by reading blocks of the first layer from the chunk section above if it exists + // If so, obfuscate the upper layer of the current chunk section by reading blocks of the first layer from the chunk section above if it exists
+ LevelChunkSection aboveChunkSection; + LevelChunkSection aboveChunkSection;
+ +
+ if (chunkSectionIndex != 15 && (aboveChunkSection = chunkPacketInfoAntiXray.getChunk().getSections()[chunkSectionIndex + 1]) != LevelChunk.EMPTY_CHUNK_SECTION) { + if (chunkSectionIndex != worldSectionHeight && (aboveChunkSection = chunkPacketInfoAntiXray.getChunk().getSections()[chunkSectionIndex + 1]) != LevelChunk.EMPTY_CHUNK_SECTION) {
+ boolean[][] temp = current; + boolean[][] temp = current;
+ current = next; + current = next;
+ next = nextNext; + next = nextNext;
@ -467,7 +463,7 @@ index 0000000000000000000000000000000000000000..db95bde2a0bb17d13d0588dd0bbb81b7
+ } + }
+ } + }
+ +
+ chunkPacketInfoAntiXray.getPacketPlayOutMapChunk().setReady(true); + chunkPacketInfoAntiXray.getChunkPacket().setReady(true);
+ } + }
+ +
+ private void obfuscateLayer(int y, DataBitsReader dataBitsReader, DataBitsWriter dataBitsWriter, boolean[] solid, boolean[] obfuscate, int[] predefinedBlockDataBits, boolean[][] current, boolean[][] next, boolean[][] nextNext, LevelChunkSection[] nearbyChunkSections, IntSupplier random) { + private void obfuscateLayer(int y, DataBitsReader dataBitsReader, DataBitsWriter dataBitsWriter, boolean[] solid, boolean[] obfuscate, int[] predefinedBlockDataBits, boolean[][] current, boolean[][] next, boolean[][] nextNext, LevelChunkSection[] nearbyChunkSections, IntSupplier random) {
@ -768,10 +764,10 @@ index 0000000000000000000000000000000000000000..db95bde2a0bb17d13d0588dd0bbb81b7
+} +}
diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfo.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfo.java diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfo.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfo.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..4d06356d4c183605fdaa9157da02c66990f0fb70 index 0000000000000000000000000000000000000000..7c3a85d65754c820e71a1db68f0c5a76c7327d9d
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfo.java +++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfo.java
@@ -0,0 +1,75 @@ @@ -0,0 +1,81 @@
+package com.destroystokyo.paper.antixray; +package com.destroystokyo.paper.antixray;
+ +
+import net.minecraft.network.protocol.game.ClientboundLevelChunkPacket; +import net.minecraft.network.protocol.game.ClientboundLevelChunkPacket;
@ -780,21 +776,27 @@ index 0000000000000000000000000000000000000000..4d06356d4c183605fdaa9157da02c669
+ +
+public class ChunkPacketInfo<T> { +public class ChunkPacketInfo<T> {
+ +
+ private final ClientboundLevelChunkPacket packetPlayOutMapChunk; + private final ClientboundLevelChunkPacket chunkPacket;
+ private final LevelChunk chunk; + private final LevelChunk chunk;
+ private byte[] data; + private byte[] data;
+ private final int[] bitsPerObject = new int[16]; + private final int[] bitsPerObject;
+ private final Object[] dataPalettes = new Object[16]; + private final Object[] dataPalettes;
+ private final int[] dataBitsIndexes = new int[16]; + private final int[] dataBitsIndexes;
+ private final Object[][] predefinedObjects = new Object[16][]; + private final Object[][] predefinedObjects;
+ +
+ public ChunkPacketInfo(ClientboundLevelChunkPacket packetPlayOutMapChunk, LevelChunk chunk) { + public ChunkPacketInfo(ClientboundLevelChunkPacket chunkPacket, LevelChunk chunk) {
+ this.packetPlayOutMapChunk = packetPlayOutMapChunk; + this.chunkPacket = chunkPacket;
+ this.chunk = chunk; + this.chunk = chunk;
+
+ int sections = chunk.getSectionsCount();
+ this.bitsPerObject = new int[sections];
+ this.dataPalettes = new Object[sections];
+ this.dataBitsIndexes = new int[sections];
+ this.predefinedObjects = new Object[sections][];
+ } + }
+ +
+ public ClientboundLevelChunkPacket getPacketPlayOutMapChunk() { + public ClientboundLevelChunkPacket getChunkPacket() {
+ return packetPlayOutMapChunk; + return chunkPacket;
+ } + }
+ +
+ public LevelChunk getChunk() { + public LevelChunk getChunk() {
@ -1254,7 +1256,7 @@ index 521f199e495f3bec232cc9ca36e51e0392afe737..164df6e9a91d9fbdbf6e4b835ea1946d
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
index 5fd66020a937b641e2a060cf38df731a43f3bf55..b10beabccf5a29098a796e5615eb4632fae95f99 100644 index 5fd66020a937b641e2a060cf38df731a43f3bf55..ec8b67c1b024df38d5e1ad81acff33537ae25626 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
@@ -20,16 +20,25 @@ public class LevelChunkSection { @@ -20,16 +20,25 @@ public class LevelChunkSection {
@ -1298,12 +1300,12 @@ index 5fd66020a937b641e2a060cf38df731a43f3bf55..b10beabccf5a29098a796e5615eb4632
+ // Paper end + // Paper end
buf.writeShort(this.nonEmptyBlockCount); buf.writeShort(this.nonEmptyBlockCount);
- this.states.write(buf); - this.states.write(buf);
+ this.states.write(buf, chunkPacketInfo, this.bottomBlockY >> 4); // Paper - Anti-Xray - Add chunk packet info + this.states.write(buf, chunkPacketInfo, this.bottomBlockY); // Paper - Anti-Xray - Add chunk packet info
} }
public int getSerializedSize() { public int getSerializedSize() {
diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
index 5ea60bbb56450502f1ceb41959239ab579458ac2..efe4d45b431890e4821f977b8f9fafdab7de3be2 100644 index 5ea60bbb56450502f1ceb41959239ab579458ac2..b5b0dbbb21f15a61017d8fc936feed30c2b193dc 100644
--- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java --- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
+++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java +++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
@@ -28,6 +28,7 @@ public class PalettedContainer<T> implements PaletteResize<T> { @@ -28,6 +28,7 @@ public class PalettedContainer<T> implements PaletteResize<T> {
@ -1375,7 +1377,7 @@ index 5ea60bbb56450502f1ceb41959239ab579458ac2..efe4d45b431890e4821f977b8f9fafda
for(int i = 0; i < bitStorage.getSize(); ++i) { for(int i = 0; i < bitStorage.getSize(); ++i) {
T object = palette.valueFor(bitStorage.get(i)); T object = palette.valueFor(bitStorage.get(i));
if (object != null) { if (object != null) {
@@ -161,11 +199,24 @@ public class PalettedContainer<T> implements PaletteResize<T> { @@ -161,11 +199,26 @@ public class PalettedContainer<T> implements PaletteResize<T> {
} }
public void writeDataPaletteBlock(FriendlyByteBuf packetDataSerializer) { this.write(packetDataSerializer); } // Paper - OBFHELPER public void writeDataPaletteBlock(FriendlyByteBuf packetDataSerializer) { this.write(packetDataSerializer); } // Paper - OBFHELPER
@ -1384,7 +1386,7 @@ index 5ea60bbb56450502f1ceb41959239ab579458ac2..efe4d45b431890e4821f977b8f9fafda
+ @Deprecated public void write(FriendlyByteBuf buf) { + @Deprecated public void write(FriendlyByteBuf buf) {
+ write(buf, null, 0); + write(buf, null, 0);
+ } + }
+ public void write(FriendlyByteBuf buf, com.destroystokyo.paper.antixray.ChunkPacketInfo<T> chunkPacketInfo, int chunkSectionIndex) { + public void write(FriendlyByteBuf buf, com.destroystokyo.paper.antixray.ChunkPacketInfo<T> chunkPacketInfo, int bottomBlockY) {
+ // Paper end + // Paper end
try { try {
this.acquire(); this.acquire();
@ -1392,16 +1394,18 @@ index 5ea60bbb56450502f1ceb41959239ab579458ac2..efe4d45b431890e4821f977b8f9fafda
this.palette.write(buf); this.palette.write(buf);
+ // Paper start - Anti-Xray - Add chunk packet info + // Paper start - Anti-Xray - Add chunk packet info
+ if (chunkPacketInfo != null) { + if (chunkPacketInfo != null) {
+ chunkPacketInfo.setBitsPerObject(chunkSectionIndex, this.bits); + // Bottom block to 0 based chunk section index
+ chunkPacketInfo.setDataPalette(chunkSectionIndex, this.palette); + int section = (bottomBlockY >> 4) - chunkPacketInfo.getChunk().getMinSection();
+ chunkPacketInfo.setDataBitsIndex(chunkSectionIndex, buf.writerIndex() + FriendlyByteBuf.getVarIntSize(this.storage.getDataBits().length)); + chunkPacketInfo.setBitsPerObject(section, this.bits);
+ chunkPacketInfo.setPredefinedObjects(chunkSectionIndex, this.predefinedObjects); + chunkPacketInfo.setDataPalette(section, this.palette);
+ chunkPacketInfo.setDataBitsIndex(section, buf.writerIndex() + FriendlyByteBuf.getVarIntSize(this.storage.getDataBits().length));
+ chunkPacketInfo.setPredefinedObjects(section, this.predefinedObjects);
+ } + }
+ // Paper end + // Paper end
buf.writeLongArray(this.storage.getRaw()); buf.writeLongArray(this.storage.getRaw());
} finally { } finally {
this.release(); this.release();
@@ -176,12 +227,14 @@ public class PalettedContainer<T> implements PaletteResize<T> { @@ -176,12 +229,14 @@ public class PalettedContainer<T> implements PaletteResize<T> {
public void read(ListTag paletteNbt, long[] data) { public void read(ListTag paletteNbt, long[] data) {
try { try {
this.acquire(); this.acquire();

Datei anzeigen

@ -23,7 +23,7 @@ index f27fadc15cb7f5c782e45885ec6a5a69963beade..2ff4d4921e2076abf415bd3c8f5173ec
})); }));
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index c1bf19629cca9a6b616a63ae7a919827ec839c12..ab39c75da393f639b8b6f20bbcb00b4f6513d702 100644 index b8ca1f73b2451307c3711076eaa43e2adb34d92e..45e30c0d78b7625a6a55e6d7d60a823b674b75db 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -487,6 +487,11 @@ public class PaperWorldConfig { @@ -487,6 +487,11 @@ public class PaperWorldConfig {
@ -37,7 +37,7 @@ index c1bf19629cca9a6b616a63ae7a919827ec839c12..ab39c75da393f639b8b6f20bbcb00b4f
+ +
public boolean antiXray; public boolean antiXray;
public EngineMode engineMode; public EngineMode engineMode;
public int maxChunkSectionIndex; public int maxBlockHeight;
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
index bb0a07a280c7d4885165e9d6488e7741aaa7b47c..9c88426ab1275ee5fb6e28be8b213533dc4ab859 100644 index bb0a07a280c7d4885165e9d6488e7741aaa7b47c..9c88426ab1275ee5fb6e28be8b213533dc4ab859 100644
--- a/src/main/java/net/minecraft/server/MCUtil.java --- a/src/main/java/net/minecraft/server/MCUtil.java

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Implement alternative item-despawn-rate
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index ab39c75da393f639b8b6f20bbcb00b4f6513d702..9ab9645f8dbda50912fd6b6d6c661ca7bdff88bd 100644 index 45e30c0d78b7625a6a55e6d7d60a823b674b75db..31f192773fe5159ed2109f0d367e6b7287ffd186 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -492,6 +492,54 @@ public class PaperWorldConfig { @@ -492,6 +492,54 @@ public class PaperWorldConfig {
@ -62,7 +62,7 @@ index ab39c75da393f639b8b6f20bbcb00b4f6513d702..9ab9645f8dbda50912fd6b6d6c661ca7
+ +
public boolean antiXray; public boolean antiXray;
public EngineMode engineMode; public EngineMode engineMode;
public int maxChunkSectionIndex; public int maxBlockHeight;
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
index 9ee1dc89dd4c6b9453e1f6f92208d454877d23c9..e0c13a112c95eed9867d4608e18dc797b0c9c9cf 100644 index 9ee1dc89dd4c6b9453e1f6f92208d454877d23c9..e0c13a112c95eed9867d4608e18dc797b0c9c9cf 100644
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java

Datei anzeigen

@ -25,10 +25,10 @@ index fe79c0add4f7cb18d487c5bb9415c40c5b551ea2..8d9ddad1879e7616d980ca70de8aecac
poiUnload = Timings.ofSafe(name + "Chunk unload - POI"); poiUnload = Timings.ofSafe(name + "Chunk unload - POI");
chunkUnload = Timings.ofSafe(name + "Chunk unload - Chunk"); chunkUnload = Timings.ofSafe(name + "Chunk unload - Chunk");
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 9ab9645f8dbda50912fd6b6d6c661ca7bdff88bd..b6d680d6d6762125db180638ee43bf9ece4dc51a 100644 index 31f192773fe5159ed2109f0d367e6b7287ffd186..f2e4939c8144b9bc7441130302ab3e2358c42063 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -575,5 +575,10 @@ public class PaperWorldConfig { @@ -574,5 +574,10 @@ public class PaperWorldConfig {
Bukkit.getLogger().warning("You have enabled permission-based Anti-Xray checking - depending on your permission plugin, this may cause performance issues"); Bukkit.getLogger().warning("You have enabled permission-based Anti-Xray checking - depending on your permission plugin, this may cause performance issues");
} }
} }

Datei anzeigen

@ -302,7 +302,7 @@ index a088cb005525fda2c9d5521ab3bac43cfa38a393..1782be43f1dbe2776abe5087d305e271
public int getHeight(Heightmap.Types type, int x, int z) { public int getHeight(Heightmap.Types type, int x, int z) {
return ((Heightmap) this.heightmaps.get(type)).getFirstAvailable(x & 15, z & 15) - 1; return ((Heightmap) this.heightmaps.get(type)).getFirstAvailable(x & 15, z & 15) - 1;
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
index b10beabccf5a29098a796e5615eb4632fae95f99..79fda9a003ca4088404d3f0490c0c6a12afa1711 100644 index ec8b67c1b024df38d5e1ad81acff33537ae25626..739abc73020e8a41a99fa52907843efe07af9b4e 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
@@ -14,11 +14,12 @@ public class LevelChunkSection { @@ -14,11 +14,12 @@ public class LevelChunkSection {
@ -375,10 +375,10 @@ index b10beabccf5a29098a796e5615eb4632fae95f99..79fda9a003ca4088404d3f0490c0c6a1
} }
diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
index efe4d45b431890e4821f977b8f9fafdab7de3be2..82a4b7969e36940cb694bd999b8c03f9c66a71dc 100644 index b5b0dbbb21f15a61017d8fc936feed30c2b193dc..2bedc0f38ef16e922197a6f8e4c17aeb9cab92fd 100644
--- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java --- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
+++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java +++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
@@ -312,6 +312,14 @@ public class PalettedContainer<T> implements PaletteResize<T> { @@ -314,6 +314,14 @@ public class PalettedContainer<T> implements PaletteResize<T> {
}); });
} }

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add toggle for always placing the dragon egg
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 3c1a84a33743b635e789024a5575fbe59b83bfe0..5e24a7eb6108dbec54192874e9d8fb292d73fbb6 100644 index 5a7ad59aba34364f8832b2f532325f9d9241952b..618acd1b5e65cbff345b35a9ea90f5c77f76436c 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -740,5 +740,10 @@ public class PaperWorldConfig { @@ -739,5 +739,10 @@ public class PaperWorldConfig {
private void perPlayerMobSpawns() { private void perPlayerMobSpawns() {
perPlayerMobSpawns = getBoolean("per-player-mob-spawns", false); perPlayerMobSpawns = getBoolean("per-player-mob-spawns", false);
} }

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] added option to disable pathfinding updates on block changes
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 5e24a7eb6108dbec54192874e9d8fb292d73fbb6..25a284491e5029ecf8d574ca821d18a6c06fa1d8 100644 index 618acd1b5e65cbff345b35a9ea90f5c77f76436c..4a44e264e817169ed0d8933d3645c3c6439eed81 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -745,5 +745,10 @@ public class PaperWorldConfig { @@ -744,5 +744,10 @@ public class PaperWorldConfig {
private void enderDragonsDeathAlwaysPlacesDragonEgg() { private void enderDragonsDeathAlwaysPlacesDragonEgg() {
enderDragonsDeathAlwaysPlacesDragonEgg = getBoolean("ender-dragons-death-always-places-dragon-egg", enderDragonsDeathAlwaysPlacesDragonEgg); enderDragonsDeathAlwaysPlacesDragonEgg = getBoolean("ender-dragons-death-always-places-dragon-egg", enderDragonsDeathAlwaysPlacesDragonEgg);
} }

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] MC-29274: Fix Wither hostility towards players
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 25a284491e5029ecf8d574ca821d18a6c06fa1d8..371110b6668794bd49777122a6a11fd89f74bccf 100644 index 4a44e264e817169ed0d8933d3645c3c6439eed81..6aed01e5bc36bb540339951c1972147478f6e7f2 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -750,5 +750,11 @@ public class PaperWorldConfig { @@ -749,5 +749,11 @@ public class PaperWorldConfig {
private void setUpdatePathfindingOnBlockUpdate() { private void setUpdatePathfindingOnBlockUpdate() {
updatePathfindingOnBlockUpdate = getBoolean("update-pathfinding-on-block-update", this.updatePathfindingOnBlockUpdate); updatePathfindingOnBlockUpdate = getBoolean("update-pathfinding-on-block-update", this.updatePathfindingOnBlockUpdate);
} }

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Allow using signs inside spawn protection
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 371110b6668794bd49777122a6a11fd89f74bccf..3b5e6d95349d51e335835b30f5a748d789adf48c 100644 index 6aed01e5bc36bb540339951c1972147478f6e7f2..fcae27a0149e2d135faefcdb135e817190ceb44b 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -756,5 +756,10 @@ public class PaperWorldConfig { @@ -755,5 +755,10 @@ public class PaperWorldConfig {
fixWitherTargetingBug = getBoolean("fix-wither-targeting-bug", false); fixWitherTargetingBug = getBoolean("fix-wither-targeting-bug", false);
log("Withers properly target players: " + fixWitherTargetingBug); log("Withers properly target players: " + fixWitherTargetingBug);
} }

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Limit item frame cursors on maps
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 3b5e6d95349d51e335835b30f5a748d789adf48c..d199c216a9cd3a53d9e85e559a3a1d1ff5c27539 100644 index fcae27a0149e2d135faefcdb135e817190ceb44b..4a5dd2527fce021e7d69d7509c3abfe39deab235 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -761,5 +761,10 @@ public class PaperWorldConfig { @@ -760,5 +760,10 @@ public class PaperWorldConfig {
private void allowUsingSignsInsideSpawnProtection() { private void allowUsingSignsInsideSpawnProtection() {
allowUsingSignsInsideSpawnProtection = getBoolean("allow-using-signs-inside-spawn-protection", allowUsingSignsInsideSpawnProtection); allowUsingSignsInsideSpawnProtection = getBoolean("allow-using-signs-inside-spawn-protection", allowUsingSignsInsideSpawnProtection);
} }

Datei anzeigen

@ -13,7 +13,7 @@ contention situations.
And this is extremely a low contention situation. And this is extremely a low contention situation.
diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
index 82a4b7969e36940cb694bd999b8c03f9c66a71dc..05d5a77c439b177dc12b8b1ebd4181a5446c0f31 100644 index 2bedc0f38ef16e922197a6f8e4c17aeb9cab92fd..33ffda30ce812a2497ba220046119445d00a11d3 100644
--- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java --- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
+++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java +++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
@@ -37,16 +37,18 @@ public class PalettedContainer<T> implements PaletteResize<T> { @@ -37,16 +37,18 @@ public class PalettedContainer<T> implements PaletteResize<T> {
@ -67,12 +67,12 @@ index 82a4b7969e36940cb694bd999b8c03f9c66a71dc..05d5a77c439b177dc12b8b1ebd4181a5
@Deprecated public void write(FriendlyByteBuf buf) { @Deprecated public void write(FriendlyByteBuf buf) {
write(buf, null, 0); write(buf, null, 0);
} }
- public void write(FriendlyByteBuf buf, com.destroystokyo.paper.antixray.ChunkPacketInfo<T> chunkPacketInfo, int chunkSectionIndex) { - public void write(FriendlyByteBuf buf, com.destroystokyo.paper.antixray.ChunkPacketInfo<T> chunkPacketInfo, int bottomBlockY) {
+ public synchronized void write(FriendlyByteBuf buf, com.destroystokyo.paper.antixray.ChunkPacketInfo<T> chunkPacketInfo, int chunkSectionIndex) { // Paper - synchronize + public synchronized void write(FriendlyByteBuf buf, com.destroystokyo.paper.antixray.ChunkPacketInfo<T> chunkPacketInfo, int bottomBlockY) { // Paper - synchronize
// Paper end // Paper end
try { try {
this.acquire(); this.acquire();
@@ -224,7 +226,7 @@ public class PalettedContainer<T> implements PaletteResize<T> { @@ -226,7 +228,7 @@ public class PalettedContainer<T> implements PaletteResize<T> {
} }
@ -81,7 +81,7 @@ index 82a4b7969e36940cb694bd999b8c03f9c66a71dc..05d5a77c439b177dc12b8b1ebd4181a5
try { try {
this.acquire(); this.acquire();
// Paper - Anti-Xray - TODO: Should this.predefinedObjects.length just be added here (faster) or should the contents be compared to calculate the size (less RAM)? // Paper - Anti-Xray - TODO: Should this.predefinedObjects.length just be added here (faster) or should the contents be compared to calculate the size (less RAM)?
@@ -259,7 +261,7 @@ public class PalettedContainer<T> implements PaletteResize<T> { @@ -261,7 +263,7 @@ public class PalettedContainer<T> implements PaletteResize<T> {
} }

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add option to fix items merging through walls
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index d199c216a9cd3a53d9e85e559a3a1d1ff5c27539..02a3033bf5c0f99fbedb900f83ace2bf6bd60ee2 100644 index 4a5dd2527fce021e7d69d7509c3abfe39deab235..1ee76ca0df91a7d23882d8647539c5135593410c 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -766,5 +766,10 @@ public class PaperWorldConfig { @@ -765,5 +765,10 @@ public class PaperWorldConfig {
private void mapItemFrameCursorLimit() { private void mapItemFrameCursorLimit() {
mapItemFrameCursorLimit = getInt("map-item-frame-cursor-limit", mapItemFrameCursorLimit); mapItemFrameCursorLimit = getInt("map-item-frame-cursor-limit", mapItemFrameCursorLimit);
} }

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Fix invulnerable end crystals
MC-108513 MC-108513
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 02a3033bf5c0f99fbedb900f83ace2bf6bd60ee2..d55bebc250a6d43a292477811a938575c2a65452 100644 index 1ee76ca0df91a7d23882d8647539c5135593410c..9974151e3bcc7db9acf3f6adacb68331f6085824 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -771,5 +771,10 @@ public class PaperWorldConfig { @@ -770,5 +770,10 @@ public class PaperWorldConfig {
private void fixItemsMergingThroughWalls() { private void fixItemsMergingThroughWalls() {
fixItemsMergingThroughWalls = getBoolean("fix-items-merging-through-walls", fixItemsMergingThroughWalls); fixItemsMergingThroughWalls = getBoolean("fix-items-merging-through-walls", fixItemsMergingThroughWalls);
} }