Update to Minecraft 1.21

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2024-06-14 01:05:00 +10:00
parent 7c6204e1a9
commit eed041d629
255 changed files with 3585 additions and 3261 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/level/ChunkProviderServer.java
+++ b/net/minecraft/server/level/ChunkProviderServer.java
@@ -81,6 +81,16 @@
@@ -82,6 +82,16 @@
this.clearCache();
}
@@ -17,7 +17,7 @@
@Override
public LightEngineThreaded getLightEngine() {
return this.lightEngine;
@@ -124,7 +134,7 @@
@@ -125,7 +135,7 @@
if (k == this.lastChunkPos[l] && chunkstatus == this.lastChunkStatus[l]) {
IChunkAccess ichunkaccess = this.lastChunk[l];
@@ -26,7 +26,7 @@
return ichunkaccess;
}
}
@@ -137,7 +147,7 @@
@@ -138,7 +148,7 @@
Objects.requireNonNull(completablefuture);
chunkproviderserver_b.managedBlock(completablefuture::isDone);
ChunkResult<IChunkAccess> chunkresult = (ChunkResult) completablefuture.join();
@@ -35,22 +35,7 @@
if (ichunkaccess1 == null && flag) {
throw (IllegalStateException) SystemUtils.pauseInIde(new IllegalStateException("Chunk not there when requested: " + chunkresult.getError()));
@@ -170,12 +180,12 @@
if (playerchunk == null) {
return null;
} else {
- ChunkResult<IChunkAccess> chunkresult = (ChunkResult) playerchunk.getFutureIfPresent(ChunkStatus.FULL).getNow((Object) null);
+ ChunkResult<IChunkAccess> chunkresult = (ChunkResult) playerchunk.getFutureIfPresent(ChunkStatus.FULL).getNow(null); // CraftBukkit - decompile error
if (chunkresult == null) {
return null;
} else {
- IChunkAccess ichunkaccess1 = (IChunkAccess) chunkresult.orElse((Object) null);
+ IChunkAccess ichunkaccess1 = (IChunkAccess) chunkresult.orElse(null); // CraftBukkit - decompile error
if (ichunkaccess1 != null) {
this.storeInCache(k, ichunkaccess1, ChunkStatus.FULL);
@@ -223,7 +233,15 @@
@@ -218,7 +228,15 @@
int l = ChunkLevel.byStatus(chunkstatus);
PlayerChunk playerchunk = this.getVisibleChunkIfPresent(k);
@@ -67,16 +52,7 @@
this.distanceManager.addTicket(TicketType.UNKNOWN, chunkcoordintpair, l, chunkcoordintpair);
if (this.chunkAbsent(playerchunk, l)) {
GameProfilerFiller gameprofilerfiller = this.level.getProfiler();
@@ -242,7 +260,7 @@
}
private boolean chunkAbsent(@Nullable PlayerChunk playerchunk, int i) {
- return playerchunk == null || playerchunk.getTicketLevel() > i;
+ return playerchunk == null || playerchunk.oldTicketLevel > i; // CraftBukkit using oldTicketLevel for isLoaded checks
}
@Override
@@ -315,11 +333,31 @@
@@ -292,11 +310,31 @@
@Override
public void close() throws IOException {
@@ -109,7 +85,7 @@
@Override
public void tick(BooleanSupplier booleansupplier, boolean flag) {
this.level.getProfiler().push("purge");
@@ -369,11 +407,11 @@
@@ -346,11 +384,11 @@
this.lastSpawnState = spawnercreature_d;
gameprofilerfiller.popPush("spawnAndTick");
@@ -123,7 +99,7 @@
Iterator iterator1 = list.iterator();
while (iterator1.hasNext()) {
@@ -576,13 +614,19 @@
@@ -560,13 +598,19 @@
}
@Override