Update to Minecraft 1.21.2

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2024-10-23 02:15:00 +11:00
parent 2c4beb962b
commit d3a23f42c3
522 changed files with 8501 additions and 6477 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/chunk/Chunk.java
+++ b/net/minecraft/world/level/chunk/Chunk.java
@@ -77,7 +77,7 @@
@@ -78,7 +78,7 @@
};
private final Map<BlockPosition, Chunk.d> tickersInLevel;
public boolean loaded;
@@ -9,16 +9,16 @@
@Nullable
private Supplier<FullChunkStatus> fullStatus;
@Nullable
@@ -93,7 +93,7 @@
public Chunk(World world, ChunkCoordIntPair chunkcoordintpair, ChunkConverter chunkconverter, LevelChunkTicks<Block> levelchunkticks, LevelChunkTicks<FluidType> levelchunkticks1, long i, @Nullable ChunkSection[] achunksection, @Nullable Chunk.c chunk_c, @Nullable BlendingData blendingdata) {
super(chunkcoordintpair, chunkconverter, world, world.registryAccess().registryOrThrow(Registries.BIOME), i, achunksection, blendingdata);
@@ -97,7 +97,7 @@
this.tickersInLevel = Maps.newHashMap();
this.unsavedListener = (chunkcoordintpair1) -> {
};
- this.level = world;
+ this.level = (WorldServer) world; // CraftBukkit - type
this.gameEventListenerRegistrySections = new Int2ObjectOpenHashMap();
HeightMap.Type[] aheightmap_type = HeightMap.Type.values();
int j = aheightmap_type.length;
@@ -111,6 +111,11 @@
@@ -115,6 +115,11 @@
this.fluidTicks = levelchunkticks1;
}
@@ -30,18 +30,18 @@
public Chunk(WorldServer worldserver, ProtoChunk protochunk, @Nullable Chunk.c chunk_c) {
this(worldserver, protochunk.getPos(), protochunk.getUpgradeData(), protochunk.unpackBlockTicks(), protochunk.unpackFluidTicks(), protochunk.getInhabitedTime(), protochunk.getSections(), chunk_c, protochunk.getBlendingData());
Iterator iterator = protochunk.getBlockEntities().values().iterator();
@@ -142,6 +147,10 @@
@@ -146,6 +151,10 @@
this.skyLightSources = protochunk.skyLightSources;
this.setLightCorrect(protochunk.isLightCorrect());
this.unsaved = true;
this.markUnsaved();
+ this.needsDecoration = true; // CraftBukkit
+ // CraftBukkit start
+ this.persistentDataContainer = protochunk.persistentDataContainer; // SPIGOT-6814: copy PDC to account for 1.17 to 1.18 chunk upgrading.
+ // CraftBukkit end
}
@Override
@@ -244,9 +253,16 @@
public void setUnsavedListener(Chunk.e chunk_e) {
@@ -267,9 +276,16 @@
}
}
@@ -58,7 +58,7 @@
int i = blockposition.getY();
ChunkSection chunksection = this.getSection(this.getSectionIndex(i));
boolean flag1 = chunksection.hasOnlyAir();
@@ -295,7 +311,8 @@
@@ -319,7 +335,8 @@
if (!chunksection.getBlockState(j, k, l).is(block)) {
return null;
} else {
@@ -68,7 +68,7 @@
iblockdata.onPlace(this.level, blockposition, iblockdata1, flag);
}
@@ -345,7 +362,12 @@
@@ -370,7 +387,12 @@
@Nullable
public TileEntity getBlockEntity(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) {
@@ -82,7 +82,7 @@
if (tileentity == null) {
NBTTagCompound nbttagcompound = (NBTTagCompound) this.pendingBlockEntities.remove(blockposition);
@@ -417,6 +439,7 @@
@@ -442,6 +464,7 @@
if (!iblockdata.hasBlockEntity()) {
Chunk.LOGGER.warn("Trying to set block entity {} at position {}, but state {} does not allow it", new Object[]{tileentity, blockposition, iblockdata});
@@ -90,7 +90,7 @@
} else {
IBlockData iblockdata1 = tileentity.getBlockState();
@@ -470,6 +493,12 @@
@@ -495,6 +518,12 @@
if (this.isInLevel()) {
TileEntity tileentity = (TileEntity) this.blockEntities.remove(blockposition);
@@ -103,7 +103,7 @@
if (tileentity != null) {
World world = this.level;
@@ -523,6 +552,57 @@
@@ -548,6 +577,57 @@
}
@@ -161,7 +161,7 @@
public boolean isEmpty() {
return false;
}
@@ -718,7 +798,7 @@
@@ -745,7 +825,7 @@
private <T extends TileEntity> void updateBlockEntityTicker(T t0) {
IBlockData iblockdata = t0.getBlockState();
@@ -170,7 +170,7 @@
if (blockentityticker == null) {
this.removeBlockEntityTicker(t0.getBlockPos());
@@ -803,7 +883,7 @@
@@ -836,7 +916,7 @@
private boolean loggedInvalidBlockState;
a(final TileEntity tileentity, final BlockEntityTicker blockentityticker) {