geforkt von Mirrors/Paper
Updated Upstream (Bukkit/CraftBukkit) (#7672)
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 7902647a PR-737: Update WorldCreator#generatorSettings docs 67556a50 PR-736: Update README CraftBukkit Changes: 10922194 Java 18 support d53c4fb6 PR-1039: Use correct ops in GeneratorSettings a567e4ae PR-1038: Removed the no longer needed getChunkUnchecked method from ChunkProviderServer. 4ac8fcce SPIGOT-6980: Since 1.18.2, World#isChunkLoaded returned false for chunks that have just been loaded (e.g. inside ChunkLoadEvent). e6cc7c70 PR-1035: Update README 3ec79a27 SPIGOT-5140: Call EntityChangeBlockEvent when a ChorusFlower is destroyed by a projectile
Dieser Commit ist enthalten in:
Ursprung
44c710fdbe
Commit
83cd94ea93
@ -132,7 +132,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ int entityTicking = 0;
|
||||
+
|
||||
+ for (ChunkHolder chunk : world.getChunkSource().chunkMap.updatingChunkMap.values()) {
|
||||
+ if (chunk.getFullChunkUnchecked() == null) {
|
||||
+ if (chunk.getFullChunkNowUnchecked() == null) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
@ -334,7 +334,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ int fullLoadedChunks = 0;
|
||||
+
|
||||
+ for (ChunkHolder chunk : allChunks) {
|
||||
+ if (chunk.getFullChunkUnchecked() != null) {
|
||||
+ if (chunk.getFullChunkNowUnchecked() != null) {
|
||||
+ ++fullLoadedChunks;
|
||||
+ }
|
||||
+ }
|
||||
|
@ -18,7 +18,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
- for (ChunkHolder chunk : world.getChunkSource().chunkMap.updatingChunkMap.values()) {
|
||||
+ for (ChunkHolder chunk : world.getChunkSource().chunkMap.updatingChunks.getUpdatingMap().values()) { // Paper - change updating chunks map
|
||||
if (chunk.getFullChunkUnchecked() == null) {
|
||||
if (chunk.getFullChunkNowUnchecked() == null) {
|
||||
continue;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
|
||||
@ -219,12 +219,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ synchronized (world.getChunkSource().chunkMap.updatingChunks) {
|
||||
+ chunks = world.getChunkSource().chunkMap.updatingChunks.getVisibleMap().clone();
|
||||
+ }
|
||||
+ return chunks.values().stream().map(ChunkHolder::getFullChunk).filter(Objects::nonNull).map(net.minecraft.world.level.chunk.LevelChunk::getBukkitChunk).toArray(Chunk[]::new);
|
||||
+ return chunks.values().stream().map(ChunkHolder::getFullChunkNow).filter(Objects::nonNull).map(net.minecraft.world.level.chunk.LevelChunk::getBukkitChunk).toArray(Chunk[]::new);
|
||||
+ // Paper end - change updating chunks map
|
||||
+ }
|
||||
+ // Paper end
|
||||
+ Long2ObjectLinkedOpenHashMap<ChunkHolder> chunks = world.getChunkSource().chunkMap.updatingChunks.getVisibleMap(); // Paper - change updating chunks map
|
||||
return chunks.values().stream().map(ChunkHolder::getFullChunk).filter(Objects::nonNull).map(net.minecraft.world.level.chunk.LevelChunk::getBukkitChunk).toArray(Chunk[]::new);
|
||||
+ Long2ObjectLinkedOpenHashMap<ChunkHolder> chunks = this.world.getChunkSource().chunkMap.updatingChunks.getVisibleMap(); // Paper - change updating chunks map
|
||||
return chunks.values().stream().map(ChunkHolder::getFullChunkNow).filter(Objects::nonNull).map(net.minecraft.world.level.chunk.LevelChunk::getBukkitChunk).toArray(Chunk[]::new);
|
||||
}
|
||||
|
||||
@@ -0,0 +0,0 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
@ -1,20 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||
Date: Wed, 9 Mar 2022 12:51:29 -0800
|
||||
Subject: [PATCH] Fix generator settings string for flat-type worlds
|
||||
|
||||
Fixes MC-195468
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/WorldGenSettings.java b/src/main/java/net/minecraft/world/level/levelgen/WorldGenSettings.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/WorldGenSettings.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/WorldGenSettings.java
|
||||
@@ -0,0 +0,0 @@ public class WorldGenSettings {
|
||||
String var8 = worldGenProperties.levelType();
|
||||
switch(var8) {
|
||||
case "flat":
|
||||
- Dynamic<JsonElement> dynamic = new Dynamic<>(JsonOps.INSTANCE, worldGenProperties.generatorSettings());
|
||||
+ Dynamic<JsonElement> dynamic = new Dynamic<>(net.minecraft.resources.RegistryOps.create(JsonOps.INSTANCE, registryManager), worldGenProperties.generatorSettings()); // Paper - needs RegistryOps to access biome registry inside FlatLevelGeneratorSettings's Codec, Fixes MC-195468
|
||||
return new WorldGenSettings(l, worldGenProperties.generateStructures(), false, withOverworld(registry, registry4, new FlatLevelSource(registry3, FlatLevelGeneratorSettings.CODEC.parse(dynamic).resultOrPartial(LOGGER::error).orElseGet(() -> {
|
||||
return FlatLevelGeneratorSettings.getDefault(registry2, registry3);
|
||||
}))));
|
@ -345,16 +345,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/WorldGenSettings.java b/src/main/java/net/minecraft/world/level/levelgen/WorldGenSettings.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/WorldGenSettings.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/WorldGenSettings.java
|
||||
@@ -0,0 +0,0 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
public class WorldGenSettings {
|
||||
- public static final Codec<WorldGenSettings> CODEC = RecordCodecBuilder.create((instance) -> {
|
||||
+ public static final Codec<WorldGenSettings> CODEC = RecordCodecBuilder.<WorldGenSettings>create((instance) -> { // Paper - decompile fix
|
||||
return instance.group(Codec.LONG.fieldOf("seed").stable().forGetter(WorldGenSettings::seed), Codec.BOOL.fieldOf("generate_features").orElse(true).stable().forGetter(WorldGenSettings::generateFeatures), Codec.BOOL.fieldOf("bonus_chest").orElse(false).stable().forGetter(WorldGenSettings::generateBonusChest), RegistryCodecs.dataPackAwareCodec(Registry.LEVEL_STEM_REGISTRY, Lifecycle.stable(), LevelStem.CODEC).xmap(LevelStem::sortMap, Function.identity()).fieldOf("dimensions").forGetter(WorldGenSettings::dimensions), Codec.STRING.optionalFieldOf("legacy_custom_options").stable().forGetter((worldGenSettings) -> {
|
||||
return worldGenSettings.legacyCustomOptions;
|
||||
})).apply(instance, instance.stable(WorldGenSettings::new));
|
||||
|
@ -5082,21 +5082,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
this.setTicketLevel(level);
|
||||
this.changedBlocksPerSection = new ShortSet[world.getSectionsCount()];
|
||||
+ this.chunkMap = (ChunkMap)playersWatchingChunkProvider; // Paper
|
||||
+ }
|
||||
+
|
||||
+ // Paper start
|
||||
+ public LevelChunk getFullChunkUnchecked() {
|
||||
+ CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> statusFuture = this.getFutureIfPresentUnchecked(ChunkStatus.FULL);
|
||||
+ Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure> either = (Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>) statusFuture.getNow(null);
|
||||
+ return (either == null) ? null : (LevelChunk) either.left().orElse(null);
|
||||
}
|
||||
|
||||
+ public ChunkAccess getAvailableChunkNow() {
|
||||
+ // Paper start
|
||||
+ public @Nullable ChunkAccess getAvailableChunkNow() {
|
||||
+ // TODO can we just getStatusFuture(EMPTY)?
|
||||
+ for (ChunkStatus curr = ChunkStatus.FULL, next = curr.getParent(); curr != next; curr = next, next = next.getParent()) {
|
||||
+ CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> future = this.getFutureIfPresentUnchecked(curr);
|
||||
+ Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure> either = future.getNow(null);
|
||||
+ if (either == null || !either.left().isPresent()) {
|
||||
+ if (either == null || either.left().isEmpty()) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ return either.left().get();
|
||||
@ -5104,10 +5098,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ return null;
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
public CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> getFutureIfPresentUnchecked(ChunkStatus leastStatus) {
|
||||
CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> completablefuture = (CompletableFuture) this.futures.get(leastStatus.getIndex());
|
||||
|
||||
// CraftBukkit start
|
||||
public LevelChunk getFullChunkNow() {
|
||||
// Note: We use the oldTicketLevel for isLoaded checks.
|
||||
@@ -0,0 +0,0 @@ public class ChunkHolder {
|
||||
return ChunkHolder.getStatus(this.ticketLevel).isOrAfter(leastStatus) ? this.getFutureIfPresentUnchecked(leastStatus) : ChunkHolder.UNLOADED_CHUNK_FUTURE;
|
||||
}
|
||||
@ -5238,7 +5231,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ this.tickingChunkFuture.complete(ChunkHolder.UNLOADED_LEVEL_CHUNK); this.isTickingReady = false; // Paper - cache chunk ticking stage
|
||||
this.tickingChunkFuture = ChunkHolder.UNLOADED_LEVEL_CHUNK_FUTURE;
|
||||
+ // Paper start - ticking chunk set
|
||||
+ LevelChunk chunkIfCached = this.getFullChunkUnchecked();
|
||||
+ LevelChunk chunkIfCached = this.getFullChunkNowUnchecked();
|
||||
+ if (chunkIfCached != null) {
|
||||
+ this.chunkMap.level.getChunkSource().tickingChunks.remove(chunkIfCached);
|
||||
+ }
|
||||
@ -5268,7 +5261,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ this.entityTickingChunkFuture.complete(ChunkHolder.UNLOADED_LEVEL_CHUNK); this.isEntityTickingReady = false; // Paper - cache chunk ticking stage
|
||||
this.entityTickingChunkFuture = ChunkHolder.UNLOADED_LEVEL_CHUNK_FUTURE;
|
||||
+ // Paper start - entity ticking chunk set
|
||||
+ LevelChunk chunkIfCached = this.getFullChunkUnchecked();
|
||||
+ LevelChunk chunkIfCached = this.getFullChunkNowUnchecked();
|
||||
+ if (chunkIfCached != null) {
|
||||
+ this.chunkMap.level.getChunkSource().entityTickingChunks.remove(chunkIfCached);
|
||||
+ }
|
||||
@ -5859,7 +5852,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ return playerChunk.getFullChunkUnchecked();
|
||||
+ return playerChunk.getFullChunkNowUnchecked();
|
||||
+ }
|
||||
+
|
||||
+ @Nullable
|
||||
|
@ -188,7 +188,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ ReferenceOpenHashSet<ChunkHolder> copy = this.chunkMap.needsChangeBroadcasting.clone();
|
||||
+ this.chunkMap.needsChangeBroadcasting.clear();
|
||||
+ for (ChunkHolder holder : copy) {
|
||||
+ holder.broadcastChanges(holder.getFullChunkUnchecked()); // LevelChunks are NEVER unloaded
|
||||
+ holder.broadcastChanges(holder.getFullChunkNowUnchecked()); // LevelChunks are NEVER unloaded
|
||||
+ if (holder.needsBroadcastChanges()) {
|
||||
+ // I DON'T want to KNOW what DUMB plugins might be doing.
|
||||
+ this.chunkMap.needsChangeBroadcasting.add(holder);
|
||||
|
@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
// Paper end - optimise chunk tick iteration
|
||||
+ // Paper start - optimise checkDespawn
|
||||
+ LevelChunk chunk = this.getFullChunkUnchecked();
|
||||
+ LevelChunk chunk = this.getFullChunkNowUnchecked();
|
||||
+ if (chunk != null) {
|
||||
+ chunk.updateGeneralAreaCache();
|
||||
+ }
|
||||
@ -30,7 +30,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
// Paper end - optimise chunk tick iteration
|
||||
+ // Paper start - optimise checkDespawn
|
||||
+ LevelChunk chunk = this.getFullChunkUnchecked();
|
||||
+ LevelChunk chunk = this.getFullChunkNowUnchecked();
|
||||
+ if (chunk != null) {
|
||||
+ chunk.removeGeneralAreaCache();
|
||||
+ }
|
||||
|
@ -12,8 +12,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
System.err.println("Unsupported Java detected (" + javaVersion + "). This version of Minecraft requires at least Java 17. Check your Java version with the command 'java -version'.");
|
||||
return;
|
||||
}
|
||||
- if (javaVersion > 61.0) {
|
||||
- System.err.println("Unsupported Java detected (" + javaVersion + "). Only up to Java 17 is supported.");
|
||||
- if (javaVersion > 62.0) {
|
||||
- System.err.println("Unsupported Java detected (" + javaVersion + "). Only up to Java 18 is supported.");
|
||||
- return;
|
||||
- }
|
||||
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 33a2b476bbde7c2c0c45e644dc99b10d65736d40
|
||||
Subproject commit 7902647a668318b7e04f817e07ae9b955d7c0485
|
@ -1 +1 @@
|
||||
Subproject commit e9f972d6744d66460a78a868d298c7f543533073
|
||||
Subproject commit 10922194f43009dea660c8b5c9fe27f136e940a6
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren