Update to Minecraft 1.20

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2023-06-08 01:30:00 +10:00
parent bac55e67d6
commit 9d740b84b0
269 changed files with 2605 additions and 2568 deletions

View File

@@ -1,24 +1,24 @@
--- a/net/minecraft/world/level/chunk/Chunk.java
+++ b/net/minecraft/world/level/chunk/Chunk.java
@@ -77,7 +77,7 @@
@@ -75,7 +75,7 @@
};
private final Map<BlockPosition, Chunk.d> tickersInLevel;
public boolean loaded;
private boolean clientLightReady;
- public final World level;
+ public final WorldServer level; // CraftBukkit - type
@Nullable
private Supplier<PlayerChunk.State> fullStatus;
private Supplier<FullChunkStatus> fullStatus;
@Nullable
@@ -94,7 +94,7 @@
@@ -91,7 +91,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);
this.tickersInLevel = Maps.newHashMap();
this.clientLightReady = false;
- 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;
@@ -112,6 +112,11 @@
@@ -109,6 +109,11 @@
this.fluidTicks = levelchunkticks1;
}
@@ -30,8 +30,8 @@
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 @@
@@ -140,6 +145,10 @@
this.skyLightSources = protochunk.skyLightSources;
this.setLightCorrect(protochunk.isLightCorrect());
this.unsaved = true;
+ this.needsDecoration = true; // CraftBukkit
@@ -41,7 +41,7 @@
}
@Override
@@ -246,9 +255,16 @@
@@ -244,9 +253,16 @@
}
}
@@ -58,7 +58,7 @@
int i = blockposition.getY();
ChunkSection chunksection = this.getSection(this.getSectionIndex(i));
boolean flag1 = chunksection.hasOnlyAir();
@@ -287,7 +303,8 @@
@@ -295,7 +311,8 @@
if (!chunksection.getBlockState(j, k, l).is(block)) {
return null;
} else {
@@ -68,7 +68,7 @@
iblockdata.onPlace(this.level, blockposition, iblockdata1, flag);
}
@@ -332,7 +349,12 @@
@@ -340,7 +357,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);
@@ -410,6 +432,13 @@
@@ -418,6 +440,13 @@
tileentity1.setRemoved();
}
@@ -96,7 +96,7 @@
}
}
@@ -439,6 +468,12 @@
@@ -447,6 +476,12 @@
if (this.isInLevel()) {
TileEntity tileentity = (TileEntity) this.blockEntities.remove(blockposition);
@@ -109,7 +109,7 @@
if (tileentity != null) {
World world = this.level;
@@ -491,6 +526,57 @@
@@ -500,6 +535,57 @@
}
@@ -167,7 +167,7 @@
public boolean isEmpty() {
return false;
}
@@ -694,7 +780,7 @@
@@ -697,7 +783,7 @@
private <T extends TileEntity> void updateBlockEntityTicker(T t0) {
IBlockData iblockdata = t0.getBlockState();
@@ -176,7 +176,7 @@
if (blockentityticker == null) {
this.removeBlockEntityTicker(t0.getBlockPos());
@@ -787,7 +873,7 @@
@@ -782,7 +868,7 @@
private boolean loggedInvalidBlockState;
a(TileEntity tileentity, BlockEntityTicker blockentityticker) {