Update to Minecraft 1.18.2

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2022-03-01 02:00:00 +11:00
parent bd40300a4f
commit 9ee989ea81
184 changed files with 1785 additions and 1785 deletions

View File

@@ -192,12 +192,3 @@
this.ticker = blockentityticker;
}
@@ -775,7 +866,7 @@
this.loggedInvalidBlockState = true;
Chunk.LOGGER.warn("Block entity {} @ {} state {} invalid for ticking:", new org.apache.logging.log4j.util.Supplier[]{this::getType, this::getPos, () -> {
return iblockdata;
- }});
+ }}); // CraftBukkit - squelch checkstyle
}
gameprofilerfiller.pop();

View File

@@ -1,7 +1,16 @@
--- a/net/minecraft/world/level/chunk/ChunkGenerator.java
+++ b/net/minecraft/world/level/chunk/ChunkGenerator.java
@@ -225,7 +225,7 @@
}
@@ -261,7 +261,7 @@
while (iterator.hasNext()) {
Holder<StructureFeature<?, ?>> holder = (Holder) iterator.next();
- Stream stream = set1.stream();
+ Stream<Holder<BiomeBase>> stream = set1.stream(); // CraftBukkit - decompile error
HolderSet holderset1 = ((StructureFeature) holder.value()).biomes();
Objects.requireNonNull(holderset1);
@@ -411,7 +411,7 @@
return null;
}
- public void applyBiomeDecoration(GeneratorAccessSeed generatoraccessseed, IChunkAccess ichunkaccess, StructureManager structuremanager) {
@@ -9,25 +18,25 @@
ChunkCoordIntPair chunkcoordintpair = ichunkaccess.getPos();
if (!SharedConstants.debugVoidTerrain(chunkcoordintpair)) {
@@ -249,7 +249,7 @@
@@ -427,7 +427,7 @@
Set<BiomeBase> set = new ObjectArraySet();
for (int k = 0; k < j; ++k) {
ChunkSection chunksection = achunksection[k];
- DataPaletteBlock datapaletteblock = chunksection.getBiomes();
+ DataPaletteBlock<BiomeBase> datapaletteblock = chunksection.getBiomes(); // CraftBukkit - decompile error
if (this instanceof ChunkProviderFlat) {
- Stream stream = this.biomeSource.possibleBiomes().stream().map(Holder::value);
+ Stream<BiomeBase> stream = this.biomeSource.possibleBiomes().stream().map(Holder::value); // CraftBukkit - decompile error
Objects.requireNonNull(set);
datapaletteblock.getAll(set::add);
@@ -278,7 +278,7 @@
StructureGenerator<?> structuregenerator = (StructureGenerator) iterator.next();
Objects.requireNonNull(set);
stream.forEach(set::add);
@@ -467,7 +467,7 @@
StructureFeature<?, ?> structurefeature = (StructureFeature) iterator.next();
seededrandom.setFeatureSeed(i, i1, l);
- Supplier supplier = () -> {
+ Supplier<String> supplier = () -> { // CraftBukkit - decompile error
Optional optional = iregistry1.getResourceKey(structuregenerator).map(Object::toString);
Optional optional = iregistry.getResourceKey(structurefeature).map(Object::toString);
Objects.requireNonNull(structuregenerator);
@@ -363,6 +363,33 @@
Objects.requireNonNull(structurefeature);
@@ -552,6 +552,33 @@
}
}
@@ -58,15 +67,6 @@
+ // CraftBukkit end
+ }
+
private static StructureBoundingBox getWritableArea(IChunkAccess ichunkaccess) {
ChunkCoordIntPair chunkcoordintpair = ichunkaccess.getPos();
int i = chunkcoordintpair.getMinBlockX();
@@ -438,7 +465,7 @@
public boolean hasFeatureChunkInRange(ResourceKey<StructureSet> resourcekey, long i, int j, int k, int l) {
StructureSet structureset = (StructureSet) this.structureSets.get(resourcekey);
Entry<StructureFeature<?, ?>, Collection<ResourceKey<BiomeBase>>> entry = (Entry) unmodifiableiterator.next();
- structurestart3 = ((StructureFeature) entry.getKey()).generate(iregistrycustom, this, this.biomeSource, definedstructuremanager, i, chunkcoordintpair, j, structuresettingsfeature1, ichunkaccess, (biomebase) -> {
+ structurestart3 = (entry.getKey()).generate(iregistrycustom, this, this.biomeSource, definedstructuremanager, i, chunkcoordintpair, j, structuresettingsfeature1, ichunkaccess, (biomebase) -> { // CraftBukkit - decompile error
Collection collection = (Collection) entry.getValue();
Objects.requireNonNull(collection);

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/world/level/chunk/ChunkSection.java
+++ b/net/minecraft/world/level/chunk/ChunkSection.java
@@ -176,6 +176,12 @@
return (BiomeBase) this.biomes.get(i, j, k);
@@ -190,6 +190,12 @@
return (Holder) this.biomes.get(i, j, k);
}
+ // CraftBukkit start
+ public void setBiome(int i, int j, int k, BiomeBase biome) {
+ public void setBiome(int i, int j, int k, Holder<BiomeBase> biome) {
+ this.biomes.set(i, j, k, biome);
+ }
+ // CraftBukkit end
+
public void fillBiomesFromNoise(BiomeResolver biomeresolver, Climate.Sampler climate_sampler, int i, int j) {
DataPaletteBlock<BiomeBase> datapaletteblock = this.getBiomes();
DataPaletteBlock<Holder<BiomeBase>> datapaletteblock = this.getBiomes();

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/chunk/IChunkAccess.java
+++ b/net/minecraft/world/level/chunk/IChunkAccess.java
@@ -77,6 +77,11 @@
@@ -80,6 +80,11 @@
protected final LevelHeightAccessor levelHeightAccessor;
protected final ChunkSection[] sections;
@@ -12,7 +12,7 @@
public IChunkAccess(ChunkCoordIntPair chunkcoordintpair, ChunkConverter chunkconverter, LevelHeightAccessor levelheightaccessor, IRegistry<BiomeBase> iregistry, long i, @Nullable ChunkSection[] achunksection, @Nullable BlendingData blendingdata) {
this.chunkPos = chunkcoordintpair;
this.upgradeData = chunkconverter;
@@ -94,7 +99,11 @@
@@ -97,7 +102,11 @@
}
replaceMissingSections(levelheightaccessor, iregistry, this.sections);
@@ -24,7 +24,7 @@
private static void replaceMissingSections(LevelHeightAccessor levelheightaccessor, IRegistry<BiomeBase> iregistry, ChunkSection[] achunksection) {
for (int i = 0; i < achunksection.length; ++i) {
@@ -258,10 +267,11 @@
@@ -259,10 +268,11 @@
public void setUnsaved(boolean flag) {
this.unsaved = flag;
@@ -37,12 +37,12 @@
}
public abstract ChunkStatus getStatus();
@@ -394,6 +404,27 @@
@@ -395,6 +405,27 @@
}
}
+ // CraftBukkit start
+ public void setBiome(int i, int j, int k, BiomeBase biome) {
+ public void setBiome(int i, int j, int k, Holder<BiomeBase> biome) {
+ try {
+ int l = QuartPos.fromBlock(this.getMinBuildHeight());
+ int i1 = l + QuartPos.fromBlock(this.getHeight()) - 1;
@@ -65,7 +65,7 @@
public void fillBiomesFromNoise(BiomeResolver biomeresolver, Climate.Sampler climate_sampler) {
ChunkCoordIntPair chunkcoordintpair = this.getPos();
int i = QuartPos.fromBlock(chunkcoordintpair.getMinBlockX());
@@ -425,8 +456,10 @@
@@ -426,8 +457,10 @@
return this;
}
@@ -77,7 +77,7 @@
private final SerializableTickContainer<Block> blocks;
private final SerializableTickContainer<FluidType> fluids;
@@ -442,5 +475,7 @@
@@ -443,5 +476,7 @@
public SerializableTickContainer<FluidType> fluids() {
return this.fluids;
}

View File

@@ -1,15 +1,42 @@
--- a/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
+++ b/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
@@ -190,7 +190,7 @@
@@ -117,7 +117,7 @@
});
logger = ChunkRegionLoader.LOGGER;
Objects.requireNonNull(logger);
- datapaletteblock = (DataPaletteBlock) dataresult.getOrThrow(false, logger::error);
+ datapaletteblock = (DataPaletteBlock) ((DataResult<DataPaletteBlock<IBlockData>>) dataresult).getOrThrow(false, logger::error); // CraftBukkit - decompile error
} else {
datapaletteblock = new DataPaletteBlock<>(Block.BLOCK_STATE_REGISTRY, Blocks.AIR.defaultBlockState(), DataPaletteBlock.e.SECTION_STATES);
}
@@ -130,7 +130,7 @@
});
logger = ChunkRegionLoader.LOGGER;
Objects.requireNonNull(logger);
- datapaletteblock1 = (DataPaletteBlock) dataresult.getOrThrow(false, logger::error);
+ datapaletteblock1 = (DataPaletteBlock) ((DataResult<DataPaletteBlock<Holder<BiomeBase>>>) dataresult).getOrThrow(false, logger::error); // CraftBukkit - decompile error
} else {
datapaletteblock1 = new DataPaletteBlock<>(iregistry.asHolderIdMap(), iregistry.getHolderOrThrow(Biomes.PLAINS), DataPaletteBlock.e.SECTION_BIOMES);
}
@@ -161,7 +161,7 @@
dataresult = BlendingData.CODEC.parse(new Dynamic(DynamicOpsNBT.INSTANCE, nbttagcompound.getCompound("blending_data")));
logger1 = ChunkRegionLoader.LOGGER;
Objects.requireNonNull(logger1);
- blendingdata = (BlendingData) dataresult.resultOrPartial(logger1::error).orElse((Object) null);
+ blendingdata = (BlendingData) ((DataResult<BlendingData>) dataresult).resultOrPartial(logger1::error).orElse(null); // CraftBukkit - decompile error
} else {
blendingdata = null;
}
@@ -192,7 +192,7 @@
dataresult = BelowZeroRetrogen.CODEC.parse(new Dynamic(DynamicOpsNBT.INSTANCE, nbttagcompound.getCompound("below_zero_retrogen")));
logger1 = ChunkRegionLoader.LOGGER;
Objects.requireNonNull(logger1);
- Optional optional = dataresult.resultOrPartial(logger1::error);
+ Optional<BelowZeroRetrogen> optional = dataresult.resultOrPartial(logger1::error); // CraftBukkit - decompile error
+ Optional<BelowZeroRetrogen> optional = ((DataResult<BelowZeroRetrogen>) dataresult).resultOrPartial(logger1::error); // CraftBukkit - decompile error
Objects.requireNonNull(protochunk);
optional.ifPresent(protochunk::setBelowZeroRetrogen);
@@ -219,6 +219,13 @@
@@ -221,6 +221,13 @@
}
}
@@ -23,7 +50,7 @@
((IChunkAccess) object).setLightCorrect(flag);
NBTTagCompound nbttagcompound2 = nbttagcompound.getCompound("Heightmaps");
EnumSet<HeightMap.Type> enumset = EnumSet.noneOf(HeightMap.Type.class);
@@ -321,7 +328,7 @@
@@ -323,7 +330,7 @@
nbttagcompound.putLong("InhabitedTime", ichunkaccess.getInhabitedTime());
nbttagcompound.putString("Status", ichunkaccess.getStatus().getName());
BlendingData blendingdata = ichunkaccess.getBlendingData();
@@ -32,7 +59,16 @@
Logger logger;
if (blendingdata != null) {
@@ -452,6 +459,11 @@
@@ -370,7 +377,7 @@
if (flag1) {
ChunkSection chunksection = achunksection[j];
- DataResult dataresult1 = ChunkRegionLoader.BLOCK_STATE_CODEC.encodeStart(DynamicOpsNBT.INSTANCE, chunksection.getStates());
+ DataResult<NBTBase> dataresult1 = ChunkRegionLoader.BLOCK_STATE_CODEC.encodeStart(DynamicOpsNBT.INSTANCE, chunksection.getStates()); // CraftBukkit - decompile error
Logger logger1 = ChunkRegionLoader.LOGGER;
Objects.requireNonNull(logger1);
@@ -454,6 +461,11 @@
nbttagcompound.put("Heightmaps", nbttagcompound3);
nbttagcompound.put("structures", packStructureData(StructurePieceSerializationContext.fromLevel(worldserver), chunkcoordintpair, ichunkaccess.getAllStarts(), ichunkaccess.getAllReferences()));

View File

@@ -32,7 +32,7 @@
- bytebuffer.flip();
+ ((java.nio.Buffer) bytebuffer).flip(); // CraftBukkit - decompile error
if (bytebuffer.remaining() < 5) {
RegionFile.LOGGER.error("Chunk {} header is truncated: expected {} but read {}", chunkcoordintpair, l, bytebuffer.remaining());
RegionFile.LOGGER.error("Chunk {} header is truncated: expected {} but read {}", new Object[]{chunkcoordintpair, l, bytebuffer.remaining()});
return null;
@@ -224,7 +225,7 @@