Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9301)

This commit is contained in:
Jake Potrebic 2023-06-12 16:51:45 -07:00 committed by GitHub
parent b48e2e352e
commit c287e921a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
904 changed files with 1598 additions and 1695 deletions

View file

@ -22,10 +22,10 @@ wants it to collect even faster, they can restore that setting back to 1 instead
Not adding it to .getType() though to keep behavior consistent with vanilla for performance reasons.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 07368f2156c46654b72205cea27c20fd5e0a105b..5cb5b71894597eb59201cfd1d5489d516cb7dbd0 100644
index 7d6e44ca0a373ad1ee46bc1fc3162585cfa0d747..925079abb26fc658770c97961fb247e12b3bb216 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -377,7 +377,7 @@ public final class CraftServer implements Server {
@@ -376,7 +376,7 @@ public final class CraftServer implements Server {
this.overrideSpawnLimits();
console.autosavePeriod = this.configuration.getInt("ticks-per.autosave");
this.warningState = WarningState.value(this.configuration.getString("settings.deprecated-verbose"));
@ -34,7 +34,7 @@ index 07368f2156c46654b72205cea27c20fd5e0a105b..5cb5b71894597eb59201cfd1d5489d51
this.minimumAPI = this.configuration.getString("settings.minimum-api");
this.loadIcon();
@@ -944,7 +944,7 @@ public final class CraftServer implements Server {
@@ -951,7 +951,7 @@ public final class CraftServer implements Server {
this.console.setMotd(config.motd);
this.overrideSpawnLimits();
this.warningState = WarningState.value(this.configuration.getString("settings.deprecated-verbose"));
@ -44,10 +44,10 @@ index 07368f2156c46654b72205cea27c20fd5e0a105b..5cb5b71894597eb59201cfd1d5489d51
this.printSaveWarning = false;
console.autosavePeriod = this.configuration.getInt("ticks-per.autosave");
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 6fc18bdcaa181b72f4b73041a4eb71757413a204..a70ba15318f70798e5c3d1c458d52ca13193acee 100644
index f186be0b65808247077f075c2a2d3af6daa40711..c00a76408b6c800bf81b2de9565c95111940c365 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -280,7 +280,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -279,7 +279,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public Chunk getChunkAt(int x, int z) {
@ -62,7 +62,7 @@ index 6fc18bdcaa181b72f4b73041a4eb71757413a204..a70ba15318f70798e5c3d1c458d52ca1
return new CraftChunk(chunk);
}
@@ -294,6 +300,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -293,6 +299,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
return new CraftChunk(this.getHandle(), x, z);
}
@ -75,7 +75,7 @@ index 6fc18bdcaa181b72f4b73041a4eb71757413a204..a70ba15318f70798e5c3d1c458d52ca1
@Override
public Chunk getChunkAt(Block block) {
Preconditions.checkArgument(block != null, "null block");
@@ -359,7 +371,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -358,7 +370,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
public boolean unloadChunkRequest(int x, int z) {
org.spigotmc.AsyncCatcher.catchOp("chunk unload"); // Spigot
if (this.isChunkLoaded(x, z)) {
@ -84,7 +84,7 @@ index 6fc18bdcaa181b72f4b73041a4eb71757413a204..a70ba15318f70798e5c3d1c458d52ca1
}
return true;
@@ -445,9 +457,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -444,9 +456,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
org.spigotmc.AsyncCatcher.catchOp("chunk load"); // Spigot
// Paper start - Optimize this method
ChunkPos chunkPos = new ChunkPos(x, z);
@ -98,7 +98,7 @@ index 6fc18bdcaa181b72f4b73041a4eb71757413a204..a70ba15318f70798e5c3d1c458d52ca1
if (immediate == null) {
immediate = world.getChunkSource().chunkMap.getUnloadingChunk(x, z);
}
@@ -455,7 +470,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -454,7 +469,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
if (!(immediate instanceof ImposterProtoChunk) && !(immediate instanceof net.minecraft.world.level.chunk.LevelChunk)) {
return false; // not full status
}
@ -107,7 +107,7 @@ index 6fc18bdcaa181b72f4b73041a4eb71757413a204..a70ba15318f70798e5c3d1c458d52ca1
world.getChunk(x, z); // make sure we're at ticket level 32 or lower
return true;
}
@@ -481,7 +496,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -480,7 +495,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
// we do this so we do not re-read the chunk data on disk
}
@ -116,7 +116,7 @@ index 6fc18bdcaa181b72f4b73041a4eb71757413a204..a70ba15318f70798e5c3d1c458d52ca1
world.getChunkSource().getChunk(x, z, ChunkStatus.FULL, true);
return true;
// Paper end
@@ -2201,6 +2216,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -2208,6 +2223,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
io.papermc.paper.chunk.system.ChunkSystem.scheduleChunkLoad(this.getHandle(), x, z, gen, ChunkStatus.FULL, true, priority, (c) -> {
net.minecraft.server.MinecraftServer.getServer().scheduleOnMain(() -> {
net.minecraft.world.level.chunk.LevelChunk chunk = (net.minecraft.world.level.chunk.LevelChunk)c;