Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci skip] fix run dev #9797

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ tasks.collectAtsFromPatches {
}

// Uncomment while updating for a new Minecraft version
tasks.withType<io.papermc.paperweight.tasks.RebuildGitPatches> {
filterPatches.set(false)
}
// tasks.withType<io.papermc.paperweight.tasks.RebuildGitPatches> {
// filterPatches.set(false)
// }

tasks.register("printMinecraftVersion") {
doLast {
Expand Down
8 changes: 4 additions & 4 deletions patches/server/0003-Build-system-changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public net.minecraft.server.packs.VanillaPackResourcesBuilder safeGetPath(Ljava/
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>

diff --git a/build.gradle.kts b/build.gradle.kts
index beb19d5aa6cb60115cbd173b2a7f67769b4a367d..3a8b06b7cafb912cf1faecd219673afea2319815 100644
index beb19d5aa6cb60115cbd173b2a7f67769b4a367d..34b1f3b634358c05668eb7401c8783546a1b89cc 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -9,10 +9,9 @@ plugins {
Expand Down Expand Up @@ -94,12 +94,12 @@ index beb19d5aa6cb60115cbd173b2a7f67769b4a367d..3a8b06b7cafb912cf1faecd219673afe
tasks.registerRunTask("runDev") {
description = "Spin up a non-relocated Mojang-mapped test server"
- classpath(sourceSets.main.map { it.runtimeClasspath })
+ classpath(tasks.filterProjectDir.flatMap { it.outputJar })
+ classpath(runtimeClasspathForRunDev)
+ classpath(tasks.filterProjectDir.flatMap { it.outputJar })
+ jvmArgs("-DPaper.isRunDev=true")
}
diff --git a/src/main/java/net/minecraft/resources/ResourceLocation.java b/src/main/java/net/minecraft/resources/ResourceLocation.java
index 68e3d54c79924d72b22eb3bc142ff47aa1700895..d3300e43523429fdd0e61c5aa9aed2e6bc78e07e 100644
index 924e0552c4b60c6fbfe1aa659e201e5349d91e09..0185ea054848f9b400533e97ac0b9a49b81db980 100644
--- a/src/main/java/net/minecraft/resources/ResourceLocation.java
+++ b/src/main/java/net/minecraft/resources/ResourceLocation.java
@@ -26,6 +26,7 @@ public class ResourceLocation implements Comparable<ResourceLocation> {
Expand Down Expand Up @@ -133,7 +133,7 @@ index 84dab998d5b91b9c5690e9e086b17a60b6dec058..2ac60ea28ce722cdef61cfdc69bbbdf3
Path path = (Path) optionset.valueOf("pidFile"); // CraftBukkit

diff --git a/src/main/java/net/minecraft/server/packs/repository/ServerPacksSource.java b/src/main/java/net/minecraft/server/packs/repository/ServerPacksSource.java
index 7db49f077704f03d1815f8382523199bd6c9a0dc..4ed8f38ba9c7b075b99a0da0e213a1e9d03ac717 100644
index 61228abc3b0628732a4b9dbdf9827adb7a2fd8d8..1522706703392d74a92c964ded7206f7c469c20c 100644
--- a/src/main/java/net/minecraft/server/packs/repository/ServerPacksSource.java
+++ b/src/main/java/net/minecraft/server/packs/repository/ServerPacksSource.java
@@ -32,7 +32,7 @@ public class ServerPacksSource extends BuiltInPackSource {
Expand Down
34 changes: 18 additions & 16 deletions patches/server/0018-Rewrite-chunk-system.patch
Original file line number Diff line number Diff line change
Expand Up @@ -16620,7 +16620,7 @@ index 0000000000000000000000000000000000000000..7e8dc9e8f381abfdcce2746edc93122d
+ }
+}
diff --git a/src/main/java/net/minecraft/network/protocol/game/ServerboundCommandSuggestionPacket.java b/src/main/java/net/minecraft/network/protocol/game/ServerboundCommandSuggestionPacket.java
index a5e438a834826161c52ca9db57d234d9ff80a591..b8bc1b9b8e8a33df90a963f9f9769292bf595642 100644
index d24b4e21f162032e7455f62b9b36ffb8c3712c61..e809d6b5b742101f47a7630b3b1ede752682249e 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ServerboundCommandSuggestionPacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ServerboundCommandSuggestionPacket.java
@@ -14,7 +14,7 @@ public class ServerboundCommandSuggestionPacket implements Packet<ServerGamePack
Expand Down Expand Up @@ -20151,7 +20151,7 @@ index f7674978f032f020887546f593024c1442719127..80105ed5ab45552d86b2302586de7511
super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile);
this.chatVisibility = ChatVisiblity.FULL;
diff --git a/src/main/java/net/minecraft/server/level/ThreadedLevelLightEngine.java b/src/main/java/net/minecraft/server/level/ThreadedLevelLightEngine.java
index 97662f8c8c125cb964d46b9095509a0da9796dba..f382d138959b34bfc3a114bc9d96e056cccbfc89 100644
index 8aa383aad9deb12ffe0a82a4571538f30cb44648..344ee307376392e9080325185793602605b2f53c 100644
--- a/src/main/java/net/minecraft/server/level/ThreadedLevelLightEngine.java
+++ b/src/main/java/net/minecraft/server/level/ThreadedLevelLightEngine.java
@@ -37,15 +37,12 @@ import net.minecraft.world.level.chunk.ChunkStatus;
Expand Down Expand Up @@ -20325,7 +20325,7 @@ index 97662f8c8c125cb964d46b9095509a0da9796dba..f382d138959b34bfc3a114bc9d96e056

public CompletableFuture<?> waitForPendingTasks(int x, int z) {
diff --git a/src/main/java/net/minecraft/server/level/Ticket.java b/src/main/java/net/minecraft/server/level/Ticket.java
index b346fa94b23d81da7da073f71dd12e672e0f079c..0edb97617f0c0da8dda901a26891b33c324715c7 100644
index 9f69b82cc8c2180182a52cf07f2f2e9ee3e90d31..c33a983818c57e44106e5a9a8d4ab4032d191d87 100644
--- a/src/main/java/net/minecraft/server/level/Ticket.java
+++ b/src/main/java/net/minecraft/server/level/Ticket.java
@@ -6,9 +6,12 @@ public final class Ticket<T> implements Comparable<Ticket<?>> {
Expand Down Expand Up @@ -20421,7 +20421,7 @@ index e96a0ca47e4701ba187555bd92c968345bc85677..73b96f804079288e9c5fcc11da54e61e
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/server/network/PlayerChunkSender.java b/src/main/java/net/minecraft/server/network/PlayerChunkSender.java
index c509a1318bcef38fd4927e38b6ee9846853e2d15..5de5209e04d631bd6a50e28e8d3abebf148252c1 100644
index a82d550697ffd11c85542cade2950d8862e37c65..aa9d88a089524024ffc49a90e54be623bfa6ed36 100644
--- a/src/main/java/net/minecraft/server/network/PlayerChunkSender.java
+++ b/src/main/java/net/minecraft/server/network/PlayerChunkSender.java
@@ -42,14 +42,22 @@ public class PlayerChunkSender {
Expand Down Expand Up @@ -20527,7 +20527,7 @@ index b30128b77d2fe8a8c1db9b5746aab537a9a25430..5ae47b3449df7a83a5c22a266f7b9e4e

while (iterator.hasNext()) {
diff --git a/src/main/java/net/minecraft/util/SortedArraySet.java b/src/main/java/net/minecraft/util/SortedArraySet.java
index ca788f0dcec4a117b410fe8348969e056b138b1e..a6ac76707da39cf86113003b1f326433fdc86c86 100644
index 0e00590f1cc0b28b2c2abe9576af891e35e21e6a..246c5c70db65a31807254102a6b17a2989e91a79 100644
--- a/src/main/java/net/minecraft/util/SortedArraySet.java
+++ b/src/main/java/net/minecraft/util/SortedArraySet.java
@@ -14,6 +14,14 @@ public class SortedArraySet<T> extends AbstractSet<T> {
Expand Down Expand Up @@ -20775,7 +20775,7 @@ index 8b3763ba7f5648c41c5bf8a72e5c801d5483e6e0..0e79e92014dd56fc2ba98ce605046362

@Override
diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
index b18b896c624d5cadc02b1db9d011d82124d61d54..6f2c7baea0d1ac7813c7b85e1f5558573745762c 100644
index bcf54eded41eb370b28807dc63d5497ce8d368cc..eff1489c8d91b0ff7c4f953d9bfb4002b6a82e94 100644
--- a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
+++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
@@ -38,12 +38,28 @@ import net.minecraft.world.level.chunk.storage.SectionStorage;
Expand Down Expand Up @@ -20850,6 +20850,8 @@ index b18b896c624d5cadc02b1db9d011d82124d61d54..6f2c7baea0d1ac7813c7b85e1f555857
@Override
protected void onSectionLoad(long pos) {
- this.distanceTracker.update(pos, this.distanceTracker.getLevelFromSource(pos), false);
- }
-
+ this.updateDistanceTracking(pos); // Paper - move to new distance tracking util
+ }
+
Expand Down Expand Up @@ -20929,8 +20931,8 @@ index b18b896c624d5cadc02b1db9d011d82124d61d54..6f2c7baea0d1ac7813c7b85e1f555857
+ this.onSectionLoad(SectionPos.asLong(chunkX, sectionY, chunkZ));
+ }
+ }
}
+ }
+
+ public void checkConsistency(net.minecraft.world.level.chunk.ChunkAccess chunk) {
+ int chunkX = chunk.getPos().x;
+ int chunkZ = chunk.getPos().z;
Expand Down Expand Up @@ -21001,7 +21003,7 @@ index b18b896c624d5cadc02b1db9d011d82124d61d54..6f2c7baea0d1ac7813c7b85e1f555857
HAS_SPACE(PoiRecord::hasSpace),
IS_OCCUPIED(PoiRecord::isOccupied),
diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiSection.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiSection.java
index 795a02941d7cecb58ec45b5e79c8d510ff21163a..3fc17817906876e83f040f908b8b1ba6cfa37b8b 100644
index b349c3836f4a63d5da3129af028fb03d002a88b4..161edb0a940c70ba5574e5310dfe14d5418f9955 100644
--- a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiSection.java
+++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiSection.java
@@ -29,6 +29,7 @@ public class PoiSection {
Expand All @@ -21026,7 +21028,7 @@ index 795a02941d7cecb58ec45b5e79c8d510ff21163a..3fc17817906876e83f040f908b8b1ba6
this.setDirty = updateListener;
this.isValid = valid;
diff --git a/src/main/java/net/minecraft/world/level/EntityGetter.java b/src/main/java/net/minecraft/world/level/EntityGetter.java
index b6a3c75b84d9f768afee33aa0f226207b307c1c0..2ec2b1d9d987c7f31c685aec3d3c87f42758c94b 100644
index 252b6dec50561bf9c910fd7b647d83bb968a9ed4..82822ec64b1fd7b6a968b0ae05790ffa9af4ba53 100644
--- a/src/main/java/net/minecraft/world/level/EntityGetter.java
+++ b/src/main/java/net/minecraft/world/level/EntityGetter.java
@@ -18,6 +18,18 @@ import net.minecraft.world.phys.shapes.Shapes;
Expand Down Expand Up @@ -21199,7 +21201,7 @@ index d87f02c748fe2e5b4ea251f6691e8907a152cb6d..5988c0847af4e8f0094328e91f736f25
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/world/level/LevelReader.java b/src/main/java/net/minecraft/world/level/LevelReader.java
index cc0d20e9f851268fe8403ac516f426ec1d008150..12eaafdbd324fa36b3f46c3b644bc8117a4123ad 100644
index 276b5ff0c70d2a47a7be2ff82288dc8dc5f3b47a..424ec90252300cd7f73e6deeec680f7d04f2f54c 100644
--- a/src/main/java/net/minecraft/world/level/LevelReader.java
+++ b/src/main/java/net/minecraft/world/level/LevelReader.java
@@ -26,6 +26,15 @@ public interface LevelReader extends BlockAndTintGetter, CollisionGetter, Signal
Expand Down Expand Up @@ -21779,7 +21781,7 @@ index 6c0f87535ffa95cf82ab4b03bb7bf8f2132d275f..b4e7c9b317d532d4915932f8f79dfebf
}
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/EntityStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/EntityStorage.java
index 98b3909b536f11eda9c481ffd74066ad0cdb0ebc..0ec0be22f7292d57c40da6f1f4575bdebf8dbd09 100644
index 00f5951f3fb78d077dd828c3d8390c4a40d387c5..5c21e31e30a99d96ad6070fced0683c579b21765 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/EntityStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/EntityStorage.java
@@ -30,43 +30,31 @@ public class EntityStorage implements EntityPersistentStorage<Entity> {
Expand Down Expand Up @@ -22149,7 +22151,7 @@ index 1988063a0cac0350ae3b3388b8f2a0c95b8b259f..2b6ba2e30c9a4682d6deb2ab750d6923

while (objectiterator.hasNext()) {
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
index 56f0e217276b01aed2f20a71f6849826285fc15b..54db563d80bbabd87a2be6f5ead92b482ac07b10 100644
index ab829edd451fed983f88b5571b32a1c443d74350..f080ff6913f903cff39e724ffbadd757be7aad6c 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
@@ -34,27 +34,28 @@ import net.minecraft.world.level.ChunkPos;
Expand Down Expand Up @@ -22248,7 +22250,7 @@ index 56f0e217276b01aed2f20a71f6849826285fc15b..54db563d80bbabd87a2be6f5ead92b48
+ // Paper - rewrite chunk system
}
diff --git a/src/main/java/net/minecraft/world/level/entity/EntityTickList.java b/src/main/java/net/minecraft/world/level/entity/EntityTickList.java
index 2830d32bba3dc85847e3a5d9b4d98f822e34b606..4cdfc433df67afcd455422e9baf56f167dd712ae 100644
index 1e18f1ebff5db01a354a35a72f925d9f7e8c390e..3ec34eed3029762b29f1d0c8b0e7b0b729a3034d 100644
--- a/src/main/java/net/minecraft/world/level/entity/EntityTickList.java
+++ b/src/main/java/net/minecraft/world/level/entity/EntityTickList.java
@@ -8,54 +8,42 @@ import javax.annotation.Nullable;
Expand Down Expand Up @@ -22347,7 +22349,7 @@ index 54308f1decc3982f30bf8b7a8a9d8865bfdbb9fd..902156477bdfc9917105f1229f760c26

while (iterator.hasNext()) {
diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java b/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java
index 1ca00340aaa201dd34e5c350d23ef53e126a0ca6..16356d7f388561300e794a52f3f263b8e7d9b880 100644
index e5f28e8bf148693714d2d538b4979badc5e9a6fa..3caf5f120fa1b5e3b221461a1b01d203d2d3a61f 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java
@@ -50,8 +50,101 @@ public class StructureCheck {
Expand Down Expand Up @@ -22510,7 +22512,7 @@ index 1ca00340aaa201dd34e5c350d23ef53e126a0ca6..16356d7f388561300e794a52f3f263b8
referencesByStructure.computeInt(structure, (feature, references) -> {
return references == null ? 1 : references + 1;
diff --git a/src/main/java/net/minecraft/world/ticks/LevelChunkTicks.java b/src/main/java/net/minecraft/world/ticks/LevelChunkTicks.java
index 9f6c2e5b5d9e8d714a47c770e255d06c0ef7c190..ac807277a6b26d140ea9873d17c7aa4fb5fe37b2 100644
index 899affb31121ad3580353594c17165f725676c9f..dc6d296e827c666e2bb64e31db5e04a95b1e10c0 100644
--- a/src/main/java/net/minecraft/world/ticks/LevelChunkTicks.java
+++ b/src/main/java/net/minecraft/world/ticks/LevelChunkTicks.java
@@ -25,6 +25,19 @@ public class LevelChunkTicks<T> implements SerializableTickContainer<T>, TickCon
Expand Down
23 changes: 13 additions & 10 deletions patches/server/0342-Anti-Xray.patch
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ index 0000000000000000000000000000000000000000..80a2dfb266ae1221680a7b24fee2f7e2
+ }
+}
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundChunksBiomesPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundChunksBiomesPacket.java
index 6cff1a98dc7cf33947ec760dbc3d3d0ec5db5f6c..51f647de153255c919b1440338cf1b3e2d6b5dbf 100644
index 157ad9decef457427857327568635d08875895c9..3ab98c93e14a171a49b44d315b6646c2f94274be 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundChunksBiomesPacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundChunksBiomesPacket.java
@@ -63,8 +63,10 @@ public record ClientboundChunksBiomesPacket(List<ClientboundChunksBiomesPacket.C
Expand All @@ -1013,7 +1013,7 @@ index 6cff1a98dc7cf33947ec760dbc3d3d0ec5db5f6c..51f647de153255c919b1440338cf1b3e

}
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
index 0711ad682206e783fd0a1e566828670321f297e2..bf6cdc08367fc26716e7904162a21e63fecab3ed 100644
index ae14aa096b8151a41fb4829c9bff68c7b365f64d..5082fb9d3dbe9dfb0473c57d33e15e3409df845a 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
@@ -33,7 +33,10 @@ public class ClientboundLevelChunkPacketData {
Expand Down Expand Up @@ -1063,7 +1063,7 @@ index 0711ad682206e783fd0a1e566828670321f297e2..bf6cdc08367fc26716e7904162a21e63

}
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkWithLightPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkWithLightPacket.java
index be89e5b8c1ea7f85aef267a15986affa5fa1fd4b..43472855136f26b282d94fd241853d862a19ae17 100644
index 9f54d7455426f0533152b8dea1e6b265668ab40a..199c98bc5f9dde81a56229927394731d3156039a 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkWithLightPacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkWithLightPacket.java
@@ -13,13 +13,30 @@ public class ClientboundLevelChunkWithLightPacket implements Packet<ClientGamePa
Expand Down Expand Up @@ -1135,7 +1135,7 @@ index bdf11a98614c9c12d3112f437651be81d0d9872a..58a1a54b676922ef0862dcab98e7aada

public void destroyAndAck(BlockPos pos, int sequence, String reason) {
diff --git a/src/main/java/net/minecraft/server/network/PlayerChunkSender.java b/src/main/java/net/minecraft/server/network/PlayerChunkSender.java
index 5de5209e04d631bd6a50e28e8d3abebf148252c1..19b3f4fa7678a038bf25efc2a8b46ddad0193fde 100644
index aa9d88a089524024ffc49a90e54be623bfa6ed36..79349991551366d931ade505d0938961f96350d2 100644
--- a/src/main/java/net/minecraft/server/network/PlayerChunkSender.java
+++ b/src/main/java/net/minecraft/server/network/PlayerChunkSender.java
@@ -85,7 +85,10 @@ public class PlayerChunkSender {
Expand Down Expand Up @@ -1263,7 +1263,7 @@ index 2c3ea88bac229df67bd742e16d2106d80bcc8889..4eeb719b40ff1c18a7cdda7ecc6b135d

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
index 1219200cd915d6239a32a2bd09d325cd8fa9b346..98e720a21432fff7fce8653095a56e2ef56f1d30 100644
index 4ba793b448691b455859b8c34d2fc5b05955c8d7..2a3b8817e057d533f675355a92241e790e3cfe0c 100644
--- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
+++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
@@ -30,6 +30,7 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer
Expand Down Expand Up @@ -1309,6 +1309,9 @@ index 1219200cd915d6239a32a2bd09d325cd8fa9b346..98e720a21432fff7fce8653095a56e2e
this.registry = idList;
this.strategy = paletteProvider;
this.data = new PalettedContainer.Data<>(dataProvider, storage, dataProvider.factory().create(dataProvider.bits(), idList, this, paletteEntries));
- }
-
- private PalettedContainer(IdMap<T> idList, PalettedContainer.Strategy paletteProvider, PalettedContainer.Data<T> data) {
+
+ if (presetValues != null && (dataProvider.factory() == PalettedContainer.Strategy.SINGLE_VALUE_PALETTE_FACTORY ? this.data.palette.valueFor(0) != defaultValue : dataProvider.factory() != PalettedContainer.Strategy.GLOBAL_PALETTE_FACTORY)) {
+ // In 1.18 Mojang unfortunately removed code that already handled possible resize operations on read from disk for us
Expand All @@ -1332,9 +1335,8 @@ index 1219200cd915d6239a32a2bd09d325cd8fa9b346..98e720a21432fff7fce8653095a56e2e
+ }
+ }
+ // Paper end
}

- private PalettedContainer(IdMap<T> idList, PalettedContainer.Strategy paletteProvider, PalettedContainer.Data<T> data) {
+ }
+
+ // Paper start - Anti-Xray - Add preset values
+ private PalettedContainer(IdMap<T> idList, PalettedContainer.Strategy paletteProvider, PalettedContainer.Data<T> data, T @org.jetbrains.annotations.Nullable [] presetValues) {
+ this.presetValues = presetValues;
Expand Down Expand Up @@ -1371,6 +1373,7 @@ index 1219200cd915d6239a32a2bd09d325cd8fa9b346..98e720a21432fff7fce8653095a56e2e
data2.copyFrom(data.palette, data.storage);
this.data = data2;
- return data2.palette.idFor(object);
- }
+ this.addPresetValues();
+ return object == null ? -1 : data2.palette.idFor(object);
+ // Paper end
Expand All @@ -1383,7 +1386,7 @@ index 1219200cd915d6239a32a2bd09d325cd8fa9b346..98e720a21432fff7fce8653095a56e2e
+ this.data.palette.idFor(presetValue);
+ }
+ }
}
+ }
+ // Paper end

public T getAndSet(int x, int y, int z, T value) {
Expand Down Expand Up @@ -1471,7 +1474,7 @@ index 1219200cd915d6239a32a2bd09d325cd8fa9b346..98e720a21432fff7fce8653095a56e2e
}

diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainerRO.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainerRO.java
index 9a2bf744abd8916d492e901be889223591bac3fd..1dd415c96d17eff8e7555c33d3c52e57f2559fa5 100644
index 40f09b6b4355f52e2542a421359119b06ec3d647..4a98634941ba433dc72788f156d65d93037cddd3 100644
--- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainerRO.java
+++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainerRO.java
@@ -14,7 +14,10 @@ public interface PalettedContainerRO<T> {
Expand Down
Loading