Update to Minecraft 1.19.3

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2022-12-08 03:00:00 +11:00
parent a13136ada2
commit 8b26bb8f3e
305 changed files with 3331 additions and 2864 deletions

View File

@@ -10,12 +10,12 @@
private Supplier<PlayerChunk.State> fullStatus;
@Nullable
@@ -94,7 +94,7 @@
super(chunkcoordintpair, chunkconverter, world, world.registryAccess().registryOrThrow(IRegistry.BIOME_REGISTRY), i, achunksection, blendingdata);
super(chunkcoordintpair, chunkconverter, world, world.registryAccess().registryOrThrow(Registries.BIOME), i, achunksection, blendingdata);
this.tickersInLevel = Maps.newHashMap();
this.clientLightReady = false;
- this.level = world;
+ this.level = (WorldServer) world; // CraftBukkit - type
this.gameEventDispatcherSections = new Int2ObjectOpenHashMap();
this.gameEventListenerRegistrySections = new Int2ObjectOpenHashMap();
HeightMap.Type[] aheightmap_type = HeightMap.Type.values();
int j = aheightmap_type.length;
@@ -110,8 +110,20 @@
@@ -174,7 +174,7 @@
public boolean isEmpty() {
return false;
}
@@ -684,7 +775,7 @@
@@ -682,7 +773,7 @@
private <T extends TileEntity> void updateBlockEntityTicker(T t0) {
IBlockData iblockdata = t0.getBlockState();
@@ -183,7 +183,7 @@
if (blockentityticker == null) {
this.removeBlockEntityTicker(t0.getBlockPos());
@@ -777,7 +868,7 @@
@@ -775,7 +866,7 @@
private boolean loggedInvalidBlockState;
a(TileEntity tileentity, BlockEntityTicker blockentityticker) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/chunk/ChunkGenerator.java
+++ b/net/minecraft/world/level/chunk/ChunkGenerator.java
@@ -417,7 +417,7 @@
@@ -306,7 +306,7 @@
}
}
@@ -9,7 +9,7 @@
ChunkCoordIntPair chunkcoordintpair = ichunkaccess.getPos();
if (!SharedConstants.debugVoidTerrain(chunkcoordintpair)) {
@@ -439,7 +439,7 @@
@@ -328,7 +328,7 @@
for (int k = 0; k < j; ++k) {
ChunkSection chunksection = achunksection[k];
@@ -18,7 +18,7 @@
Objects.requireNonNull(set);
palettedcontainerro.getAll(set::add);
@@ -465,7 +465,7 @@
@@ -354,7 +354,7 @@
Structure structure = (Structure) iterator.next();
seededrandom.setFeatureSeed(i, i1, l);
@@ -27,12 +27,12 @@
Optional optional = iregistry.getResourceKey(structure).map(Object::toString);
Objects.requireNonNull(structure);
@@ -550,6 +550,33 @@
@@ -439,6 +439,33 @@
}
}
+ // CraftBukkit start
+ public void applyBiomeDecoration(GeneratorAccessSeed generatoraccessseed, IChunkAccess ichunkaccess, StructureManager structuremanager) {
+ // CraftBukkit start
+ applyBiomeDecoration(generatoraccessseed, ichunkaccess, structuremanager, true);
+ }
+
@@ -55,9 +55,9 @@
+ limitedRegion.saveEntities();
+ limitedRegion.breakLink();
+ }
+ // CraftBukkit end
+ }
+ // CraftBukkit end
+
public boolean hasStructureChunkInRange(Holder<StructureSet> holder, RandomState randomstate, long i, int j, int k, int l) {
StructureSet structureset = (StructureSet) holder.value();
private static StructureBoundingBox getWritableArea(IChunkAccess ichunkaccess) {
ChunkCoordIntPair chunkcoordintpair = ichunkaccess.getPos();
int i = chunkcoordintpair.getMinBlockX();

View File

@@ -0,0 +1,7 @@
--- a/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
+++ b/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
@@ -1,3 +1,4 @@
+// mc-dev import
package net.minecraft.world.level.chunk;
import com.google.common.base.Stopwatch;

View File

@@ -1,11 +1,11 @@
--- a/net/minecraft/world/level/chunk/ChunkStatus.java
+++ b/net/minecraft/world/level/chunk/ChunkStatus.java
@@ -47,7 +47,7 @@
@@ -48,7 +48,7 @@
});
public static final ChunkStatus STRUCTURE_STARTS = register("structure_starts", ChunkStatus.EMPTY, 0, ChunkStatus.PRE_FEATURES, ChunkStatus.Type.PROTOCHUNK, (chunkstatus, executor, worldserver, chunkgenerator, structuretemplatemanager, lightenginethreaded, function, list, ichunkaccess, flag) -> {
if (!ichunkaccess.getStatus().isOrAfter(chunkstatus)) {
- if (worldserver.getServer().getWorldData().worldGenSettings().generateStructures()) {
+ if (worldserver.serverLevelData.worldGenSettings().generateStructures()) { // CraftBukkit
chunkgenerator.createStructures(worldserver.registryAccess(), worldserver.getChunkSource().randomState(), worldserver.structureManager(), ichunkaccess, structuretemplatemanager, worldserver.getSeed());
- if (worldserver.getServer().getWorldData().worldGenOptions().generateStructures()) {
+ if (worldserver.serverLevelData.worldGenOptions().generateStructures()) { // CraftBukkit
chunkgenerator.createStructures(worldserver.registryAccess(), worldserver.getChunkSource().getGeneratorState(), worldserver.structureManager(), ichunkaccess, structuretemplatemanager);
}

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
+++ b/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
@@ -100,7 +100,7 @@
@@ -102,7 +102,7 @@
ChunkProviderServer chunkproviderserver = worldserver.getChunkSource();
LightEngine lightengine = chunkproviderserver.getLightEngine();
IRegistry<BiomeBase> iregistry = worldserver.registryAccess().registryOrThrow(IRegistry.BIOME_REGISTRY);
IRegistry<BiomeBase> iregistry = worldserver.registryAccess().registryOrThrow(Registries.BIOME);
- Codec<PalettedContainerRO<Holder<BiomeBase>>> codec = makeBiomeCodec(iregistry);
+ Codec<DataPaletteBlock<Holder<BiomeBase>>> codec = makeBiomeCodecRW(iregistry); // CraftBukkit - read/write
boolean flag2 = false;
DataResult dataresult;
@@ -120,12 +120,12 @@
@@ -122,12 +122,12 @@
});
logger = ChunkRegionLoader.LOGGER;
Objects.requireNonNull(logger);
@@ -24,7 +24,7 @@
if (nbttagcompound1.contains("biomes", 10)) {
dataresult = codec.parse(DynamicOpsNBT.INSTANCE, nbttagcompound1.getCompound("biomes")).promotePartial((s) -> {
@@ -133,12 +133,12 @@
@@ -135,12 +135,12 @@
});
logger = ChunkRegionLoader.LOGGER;
Objects.requireNonNull(logger);
@@ -39,7 +39,7 @@
achunksection[k] = chunksection;
villageplace.checkConsistencyWithBlocks(chunkcoordintpair, chunksection);
@@ -172,7 +172,7 @@
@@ -174,7 +174,7 @@
dataresult = BlendingData.CODEC.parse(new Dynamic(DynamicOpsNBT.INSTANCE, nbttagcompound.getCompound("blending_data")));
logger1 = ChunkRegionLoader.LOGGER;
Objects.requireNonNull(logger1);
@@ -48,7 +48,7 @@
} else {
blendingdata = null;
}
@@ -203,7 +203,7 @@
@@ -205,7 +205,7 @@
dataresult = BelowZeroRetrogen.CODEC.parse(new Dynamic(DynamicOpsNBT.INSTANCE, nbttagcompound.getCompound("below_zero_retrogen")));
logger1 = ChunkRegionLoader.LOGGER;
Objects.requireNonNull(logger1);
@@ -57,7 +57,7 @@
Objects.requireNonNull(protochunk);
optional.ifPresent(protochunk::setBelowZeroRetrogen);
@@ -232,6 +232,13 @@
@@ -234,6 +234,13 @@
}
}
@@ -71,7 +71,7 @@
((IChunkAccess) object1).setLightCorrect(flag);
NBTTagCompound nbttagcompound2 = nbttagcompound.getCompound("Heightmaps");
EnumSet<HeightMap.Type> enumset = EnumSet.noneOf(HeightMap.Type.class);
@@ -322,6 +329,12 @@
@@ -328,6 +335,12 @@
return DataPaletteBlock.codecRO(iregistry.asHolderIdMap(), iregistry.holderByNameCodec(), DataPaletteBlock.d.SECTION_BIOMES, iregistry.getHolderOrThrow(Biomes.PLAINS));
}
@@ -84,7 +84,7 @@
public static NBTTagCompound write(WorldServer worldserver, IChunkAccess ichunkaccess) {
ChunkCoordIntPair chunkcoordintpair = ichunkaccess.getPos();
NBTTagCompound nbttagcompound = new NBTTagCompound();
@@ -334,7 +347,7 @@
@@ -340,7 +353,7 @@
nbttagcompound.putLong("InhabitedTime", ichunkaccess.getInhabitedTime());
nbttagcompound.putString("Status", ichunkaccess.getStatus().getName());
BlendingData blendingdata = ichunkaccess.getBlendingData();
@@ -93,7 +93,7 @@
Logger logger;
if (blendingdata != null) {
@@ -381,7 +394,7 @@
@@ -387,7 +400,7 @@
if (flag1) {
ChunkSection chunksection = achunksection[j];
@@ -102,7 +102,7 @@
Logger logger1 = ChunkRegionLoader.LOGGER;
Objects.requireNonNull(logger1);
@@ -465,6 +478,11 @@
@@ -471,6 +484,11 @@
nbttagcompound.put("Heightmaps", nbttagcompound3);
nbttagcompound.put("structures", packStructureData(StructurePieceSerializationContext.fromLevel(worldserver), chunkcoordintpair, ichunkaccess.getAllStarts(), ichunkaccess.getAllReferences()));

View File

@@ -13,7 +13,7 @@
Path path = this.folder;
int j = chunkcoordintpair.getRegionX();
Path path1 = path.resolve("r." + j + "." + chunkcoordintpair.getRegionZ() + ".mca");
+ if (existingOnly && !Files.exists(path1)) return null; // CraftBukkit
+ if (existingOnly && !java.nio.file.Files.exists(path1)) return null; // CraftBukkit
RegionFile regionfile1 = new RegionFile(path1, this.folder, this.sync);
this.regionCache.putAndMoveToFirst(i, regionfile1);