Dieser Commit ist enthalten in:
Jake Potrebic 2024-04-23 11:03:16 -07:00
Ursprung abc49bf069
Commit f2c45ed1d3
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: ECE0B3C133C016C5
7 geänderte Dateien mit 223 neuen und 264 gelöschten Zeilen

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Test changes
diff --git a/build.gradle.kts b/build.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts
index 50d9182a4845564cd62b026700a7d0517c25e74d..69155f6badcd79b3479654363ca1f1d8a138a7ad 100644 index 2905c7273ed4d62a7f1bc7eab9ae919ee6c012de..e5f1c91937af872109e478b99a6037332994e717 100644
--- a/build.gradle.kts --- a/build.gradle.kts
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -23,6 +23,7 @@ dependencies { @@ -23,6 +23,7 @@ dependencies {
@ -15,7 +15,7 @@ index 50d9182a4845564cd62b026700a7d0517c25e74d..69155f6badcd79b3479654363ca1f1d8
+ testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest + testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest
} }
val craftbukkitPackageVersion = "1_20_R3" // Paper val craftbukkitPackageVersion = "1_20_R4" // Paper
@@ -53,6 +54,12 @@ tasks.jar { @@ -53,6 +54,12 @@ tasks.jar {
} }
} }
@ -338,10 +338,10 @@ index 0000000000000000000000000000000000000000..6cbf11c898439834cffb99ef84e5df14
+ String[] value() default {}; + String[] value() default {};
+} +}
diff --git a/src/test/java/org/bukkit/support/DummyServer.java b/src/test/java/org/bukkit/support/DummyServer.java diff --git a/src/test/java/org/bukkit/support/DummyServer.java b/src/test/java/org/bukkit/support/DummyServer.java
index b19d4f7d1fcb604b448a5084f6bfe56d47ab12b3..f3017525b0c2397fdc7ce0778add2e7b38e9e2ba 100644 index ee0cff84379bc0539b2c611a4904aff9f5843814..02a8e6b45bf304b6e0f88043a25188aa16b3d6bf 100644
--- a/src/test/java/org/bukkit/support/DummyServer.java --- a/src/test/java/org/bukkit/support/DummyServer.java
+++ b/src/test/java/org/bukkit/support/DummyServer.java +++ b/src/test/java/org/bukkit/support/DummyServer.java
@@ -48,6 +48,15 @@ public final class DummyServer { @@ -50,6 +50,15 @@ public final class DummyServer {
return registers.computeIfAbsent(aClass, key -> CraftRegistry.createRegistry(aClass, AbstractTestingBase.REGISTRY_CUSTOM)); return registers.computeIfAbsent(aClass, key -> CraftRegistry.createRegistry(aClass, AbstractTestingBase.REGISTRY_CUSTOM));
}); });

Datei anzeigen

@ -15,17 +15,17 @@ public net.minecraft.server.dedicated.DedicatedServerProperties reload(Lnet/mine
public net.minecraft.world.level.NaturalSpawner SPAWNING_CATEGORIES public net.minecraft.world.level.NaturalSpawner SPAWNING_CATEGORIES
diff --git a/build.gradle.kts b/build.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts
index 69155f6badcd79b3479654363ca1f1d8a138a7ad..8332781de54d73cb5803828e98882a731daed81f 100644 index e5f1c91937af872109e478b99a6037332994e717..2fb082175529e52604d7e2f4a272fc58d0ec2eb1 100644
--- a/build.gradle.kts --- a/build.gradle.kts
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -11,6 +11,7 @@ dependencies { @@ -11,6 +11,7 @@ dependencies {
implementation("jline:jline:2.12.1") implementation("jline:jline:2.12.1")
implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion implementation("org.apache.logging.log4j:log4j-iostreams:2.22.1") // Paper - remove exclusion
implementation("org.ow2.asm:asm-commons:9.7") implementation("org.ow2.asm:asm-commons:9.7")
+ implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files + implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files
implementation("commons-lang:commons-lang:2.6") implementation("commons-lang:commons-lang:2.6")
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1") runtimeOnly("org.xerial:sqlite-jdbc:3.45.3.0")
runtimeOnly("com.mysql:mysql-connector-j:8.2.0") runtimeOnly("com.mysql:mysql-connector-j:8.3.0")
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..ef41cf3a7d1e6f2bfe81e0fb865d2f969bbc77c1 index 0000000000000000000000000000000000000000..ef41cf3a7d1e6f2bfe81e0fb865d2f969bbc77c1
@ -4824,11 +4824,11 @@ index 0000000000000000000000000000000000000000..614aba60bb07946a144650fd3aedb316
+ protected abstract boolean belowZero(O value); + protected abstract boolean belowZero(O value);
+} +}
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index 602964d92ddf9e4ec47ed3cb45787fdd061a881e..66550ce5cc83534af8dcac338db5cd4cfb1c46c4 100644 index b334265d4015fec13d7fedbffba2b6c22f4c8bc8..5b4ac7b4fd0077e900e9f788963f1613bbc9a5d0 100644
--- a/src/main/java/net/minecraft/server/Main.java --- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java
@@ -126,6 +126,10 @@ public class Main { @@ -129,6 +129,10 @@ public class Main {
dedicatedserversettings.forceSave(); RegionFileVersion.configure(dedicatedserversettings.getProperties().regionFileComression);
Path path2 = Paths.get("eula.txt"); Path path2 = Paths.get("eula.txt");
Eula eula = new Eula(path2); Eula eula = new Eula(path2);
+ // Paper start - load config files early for access below if needed + // Paper start - load config files early for access below if needed
@ -4838,7 +4838,7 @@ index 602964d92ddf9e4ec47ed3cb45787fdd061a881e..66550ce5cc83534af8dcac338db5cd4c
if (optionset.has("initSettings")) { // CraftBukkit if (optionset.has("initSettings")) { // CraftBukkit
// CraftBukkit start - SPIGOT-5761: Create bukkit.yml and commands.yml if not present // CraftBukkit start - SPIGOT-5761: Create bukkit.yml and commands.yml if not present
@@ -160,7 +164,7 @@ public class Main { @@ -163,7 +167,7 @@ public class Main {
} }
File file = (File) optionset.valueOf("universe"); // CraftBukkit File file = (File) optionset.valueOf("universe"); // CraftBukkit
@ -4848,10 +4848,10 @@ index 602964d92ddf9e4ec47ed3cb45787fdd061a881e..66550ce5cc83534af8dcac338db5cd4c
String s = (String) Optional.ofNullable((String) optionset.valueOf("world")).orElse(dedicatedserversettings.getProperties().levelName); String s = (String) Optional.ofNullable((String) optionset.valueOf("world")).orElse(dedicatedserversettings.getProperties().levelName);
LevelStorageSource convertable = LevelStorageSource.createDefault(file.toPath()); LevelStorageSource convertable = LevelStorageSource.createDefault(file.toPath());
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 42da710d18063aed6fd450fe31277d7daf0542c1..62e096c9cc05c387ca2413a490f44c6c66a5c41e 100644 index c54979d2509ce30f2ba0d956b5c6d48342e1a0fc..254e362cd54359512285bab632dbae3cec0f03e0 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -295,6 +295,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -302,6 +302,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
private static final int SAMPLE_INTERVAL = 100; private static final int SAMPLE_INTERVAL = 100;
public final double[] recentTps = new double[ 3 ]; public final double[] recentTps = new double[ 3 ];
// Spigot end // Spigot end
@ -4859,7 +4859,7 @@ index 42da710d18063aed6fd450fe31277d7daf0542c1..62e096c9cc05c387ca2413a490f44c6c
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) { public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference(); AtomicReference<S> atomicreference = new AtomicReference();
@@ -388,6 +389,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -398,6 +399,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this)); Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
// CraftBukkit end // CraftBukkit end
@ -4908,10 +4908,10 @@ index dfbb04800d6f1dcbb909fcdfeb1ebf1a5efa6a48..5928e5f1934b8e247ba516595018ed5c
@Nullable @Nullable
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 57fdf24730d93e4dc48bacfa8f034fc99a48f0e4..8ddfd4a148c95d0d9e93edf03ddac46332936d9a 100644 index 277a66863f76d9a7bf59ca87553fc1d335fc73ca..1b5e2e07a7723f61d4c4d4e3141c60b2f63e2b69 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -183,6 +183,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -196,6 +196,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
org.spigotmc.SpigotConfig.init((java.io.File) this.options.valueOf("spigot-settings")); org.spigotmc.SpigotConfig.init((java.io.File) this.options.valueOf("spigot-settings"));
org.spigotmc.SpigotConfig.registerCommands(); org.spigotmc.SpigotConfig.registerCommands();
// Spigot end // Spigot end
@ -4923,7 +4923,7 @@ index 57fdf24730d93e4dc48bacfa8f034fc99a48f0e4..8ddfd4a148c95d0d9e93edf03ddac463
this.setPvpAllowed(dedicatedserverproperties.pvp); this.setPvpAllowed(dedicatedserverproperties.pvp);
this.setFlightAllowed(dedicatedserverproperties.allowFlight); this.setFlightAllowed(dedicatedserverproperties.allowFlight);
diff --git a/src/main/java/net/minecraft/server/dedicated/Settings.java b/src/main/java/net/minecraft/server/dedicated/Settings.java diff --git a/src/main/java/net/minecraft/server/dedicated/Settings.java b/src/main/java/net/minecraft/server/dedicated/Settings.java
index 397c978c71f36c8abe1c52e545699fc7928a6917..fc45c2c4ecdf3906df6bceaf3e019c462fe62186 100644 index 6d89a5414f46a0c30badb4fcd25bc6cb6d18db3a..0ec3b546db0cf3858dd9cd9ea067d1d6713a8491 100644
--- a/src/main/java/net/minecraft/server/dedicated/Settings.java --- a/src/main/java/net/minecraft/server/dedicated/Settings.java
+++ b/src/main/java/net/minecraft/server/dedicated/Settings.java +++ b/src/main/java/net/minecraft/server/dedicated/Settings.java
@@ -119,6 +119,7 @@ public abstract class Settings<T extends Settings<T>> { @@ -119,6 +119,7 @@ public abstract class Settings<T extends Settings<T>> {
@ -4935,10 +4935,10 @@ index 397c978c71f36c8abe1c52e545699fc7928a6917..fc45c2c4ecdf3906df6bceaf3e019c46
} }
// CraftBukkit end // CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 50b79de15571ef30f202bae5952a9f825902e11a..aac9513ff4d3d494860bd06607cf8af5e466fd5b 100644 index d7c5e872136d0452311b316c5703050c45960230..cc5e1076bdf7b4794ee79934fb70234ba61efe15 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -236,7 +236,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -241,7 +241,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Holder holder = worlddimension.type(); // CraftBukkit - decompile error // Holder holder = worlddimension.type(); // CraftBukkit - decompile error
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error // Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
@ -4948,10 +4948,10 @@ index 50b79de15571ef30f202bae5952a9f825902e11a..aac9513ff4d3d494860bd06607cf8af5
this.convertable = convertable_conversionsession; this.convertable = convertable_conversionsession;
this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile()); this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile());
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index f7e8cabd6ef7d31b785b69db1d5b24d55563dbe4..bd9ea2bd012cdcf07ac322b3e0360c6c336ab1f9 100644 index ecbb926986bbc0ad6fe108b782cdc17ee8a9f035..b06ffa8d5953c8f0a47daf056495cd424d9ac843 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -158,6 +158,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -155,6 +155,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public final it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<SpawnCategory> ticksPerSpawnCategory = new it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<>(); public final it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<SpawnCategory> ticksPerSpawnCategory = new it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<>();
public boolean populating; public boolean populating;
public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot
@ -4964,7 +4964,7 @@ index f7e8cabd6ef7d31b785b69db1d5b24d55563dbe4..bd9ea2bd012cdcf07ac322b3e0360c6c
public final SpigotTimings.WorldTimingsHandler timings; // Spigot public final SpigotTimings.WorldTimingsHandler timings; // Spigot
public static BlockPos lastPhysicsProblem; // Spigot public static BlockPos lastPhysicsProblem; // Spigot
@@ -175,8 +181,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -172,8 +178,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public abstract ResourceKey<LevelStem> getTypeKey(); public abstract ResourceKey<LevelStem> getTypeKey();
@ -4976,7 +4976,7 @@ index f7e8cabd6ef7d31b785b69db1d5b24d55563dbe4..bd9ea2bd012cdcf07ac322b3e0360c6c
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env); this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 680a308c466c0056d4213e61f69cf13ee3ff5c61..cd39509d383c47319b71797e5d1df41c2b8c7ab6 100644 index 332d4e0771cf5a4eddd44b9a380df52fb8ab5d42..02ddd4e200a86d720297dbec508480fc0cd270d1 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -927,6 +927,7 @@ public final class CraftServer implements Server { @@ -927,6 +927,7 @@ public final class CraftServer implements Server {
@ -4988,10 +4988,10 @@ index 680a308c466c0056d4213e61f69cf13ee3ff5c61..cd39509d383c47319b71797e5d1df41c
world.serverLevelData.setDifficulty(config.difficulty); world.serverLevelData.setDifficulty(config.difficulty);
world.setSpawnSettings(config.spawnMonsters, config.spawnAnimals); world.setSpawnSettings(config.spawnMonsters, config.spawnAnimals);
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 67d347741db1c5a9a6568ee084388a59e35b16ea..cc6d96c5015b4e5614e8091dc9113e82e9babc25 100644 index 4b8602b168f9dd386aa72b4e5d189c441c93542e..1e3ca7ca98abfd5be233a7eeb6dad201776d2d6a 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java --- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -141,6 +141,19 @@ public class Main { @@ -142,6 +142,19 @@ public class Main {
.defaultsTo(new File("spigot.yml")) .defaultsTo(new File("spigot.yml"))
.describedAs("Yml file"); .describedAs("Yml file");
// Spigot End // Spigot End
@ -5012,7 +5012,7 @@ index 67d347741db1c5a9a6568ee084388a59e35b16ea..cc6d96c5015b4e5614e8091dc9113e82
}; };
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
index 6b778bed6d61f941c839dec01b8733a9b1fbefec..df29015e3d5ca49297fe87090fd6446962e59adb 100644 index 9658f2961d9b5632ad1abdba26a2443642624f69..38219af7d0ba2d871711102b6a29139a49678f6b 100644
--- a/src/main/java/org/spigotmc/SpigotConfig.java --- a/src/main/java/org/spigotmc/SpigotConfig.java
+++ b/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java
@@ -96,7 +96,7 @@ public class SpigotConfig @@ -96,7 +96,7 @@ public class SpigotConfig
@ -5072,7 +5072,7 @@ index 0000000000000000000000000000000000000000..0396589795da1f83ddf62426236dde9a
+ } + }
+} +}
diff --git a/src/test/java/org/bukkit/support/AbstractTestingBase.java b/src/test/java/org/bukkit/support/AbstractTestingBase.java diff --git a/src/test/java/org/bukkit/support/AbstractTestingBase.java b/src/test/java/org/bukkit/support/AbstractTestingBase.java
index 0619361adf57fdc41c4ecb09d1d6a5c862a85f89..b786ed8e620feb51baceae41dd2d1538dc298705 100644 index 544307fe34cbcfa286a7d7b30900ebea127d189e..1b1d51a68c0abe7d8f0aa1172064192c71ae645e 100644
--- a/src/test/java/org/bukkit/support/AbstractTestingBase.java --- a/src/test/java/org/bukkit/support/AbstractTestingBase.java
+++ b/src/test/java/org/bukkit/support/AbstractTestingBase.java +++ b/src/test/java/org/bukkit/support/AbstractTestingBase.java
@@ -63,6 +63,7 @@ public abstract class AbstractTestingBase { @@ -63,6 +63,7 @@ public abstract class AbstractTestingBase {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] MC Dev fixes
diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java
index 1a4cab0b9995b733aa84b89129009a99177eee9b..ead823fa2a143acb05b33152ee1e5ee4b4936a20 100644 index 478d2114fbd5c499a8adbf8b6cefcc8335e830dc..2074d4327f0c356c220f3a6a9761439e76a15fc3 100644
--- a/src/main/java/net/minecraft/core/BlockPos.java --- a/src/main/java/net/minecraft/core/BlockPos.java
+++ b/src/main/java/net/minecraft/core/BlockPos.java +++ b/src/main/java/net/minecraft/core/BlockPos.java
@@ -405,12 +405,12 @@ public class BlockPos extends Vec3i { @@ -427,12 +427,12 @@ public class BlockPos extends Vec3i {
if (this.index == l) { if (this.index == l) {
return this.endOfData(); return this.endOfData();
} else { } else {
@ -27,23 +27,23 @@ index 1a4cab0b9995b733aa84b89129009a99177eee9b..ead823fa2a143acb05b33152ee1e5ee4
} }
}; };
diff --git a/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java b/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java diff --git a/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java b/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java
index d14613f7d37198276c251e73703b060a971fac28..e8afaa3c1fab0435acb068426091bdf776263112 100644 index 433b6673ea62d466c466c1ff3732041a8fcbb6b5..bc91370654f5da33cbfe7d42431568915c1159d6 100644
--- a/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java --- a/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java
+++ b/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java +++ b/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java
@@ -307,7 +307,7 @@ public class BuiltInRegistries { @@ -299,7 +299,7 @@ public class BuiltInRegistries {
Bootstrap.checkBootstrapCalled(() -> "registry " + key); Bootstrap.checkBootstrapCalled(() -> "registry " + key);
ResourceLocation resourceLocation = key.location(); ResourceLocation resourceLocation = key.location();
LOADERS.put(resourceLocation, () -> initializer.run(registry)); LOADERS.put(resourceLocation, () -> initializer.run(registry));
- WRITABLE_REGISTRY.register((ResourceKey<WritableRegistry<?>>)key, registry, lifecycle); - WRITABLE_REGISTRY.register((ResourceKey<WritableRegistry<?>>)key, registry, RegistrationInfo.BUILT_IN);
+ WRITABLE_REGISTRY.register((ResourceKey)key, registry, lifecycle); // Paper - decompile fix + WRITABLE_REGISTRY.register((ResourceKey)key, registry, RegistrationInfo.BUILT_IN); // Paper - decompile fix
return registry; return registry;
} }
diff --git a/src/main/java/net/minecraft/nbt/TagParser.java b/src/main/java/net/minecraft/nbt/TagParser.java diff --git a/src/main/java/net/minecraft/nbt/TagParser.java b/src/main/java/net/minecraft/nbt/TagParser.java
index 733303e860560f4c93372326ab4efdaf21e5ace7..ebe0efe488357ae895aaf752e9bc008b96db156f 100644 index a614e960fcd5958ad17b679eee8a8e6926f58e62..da101bca71f4710812621b98f0a0d8cab180346a 100644
--- a/src/main/java/net/minecraft/nbt/TagParser.java --- a/src/main/java/net/minecraft/nbt/TagParser.java
+++ b/src/main/java/net/minecraft/nbt/TagParser.java +++ b/src/main/java/net/minecraft/nbt/TagParser.java
@@ -252,11 +252,11 @@ public class TagParser { @@ -253,11 +253,11 @@ public class TagParser {
} }
if (typeReader == ByteTag.TYPE) { if (typeReader == ByteTag.TYPE) {
@ -58,33 +58,11 @@ index 733303e860560f4c93372326ab4efdaf21e5ace7..ebe0efe488357ae895aaf752e9bc008b
} }
if (!this.hasElementSeparator()) { if (!this.hasElementSeparator()) {
diff --git a/src/main/java/net/minecraft/network/ConnectionProtocol.java b/src/main/java/net/minecraft/network/ConnectionProtocol.java
index 68ccf051f5a769abaa0bf9508add9303c56a1193..9d6dafb4855af9ccb7bc033ebf0fca5f75ceb9c6 100644
--- a/src/main/java/net/minecraft/network/ConnectionProtocol.java
+++ b/src/main/java/net/minecraft/network/ConnectionProtocol.java
@@ -451,7 +451,7 @@ public enum ConnectionProtocol {
protocol()
.addFlow(
PacketFlow.CLIENTBOUND,
- new ConnectionProtocol.PacketSet<ClientCommonPacketListener>()
+ new ConnectionProtocol.PacketSet<net.minecraft.network.protocol.configuration.ClientConfigurationPacketListener>() // Paper - decompile fix
.addPacket(ClientboundCustomPayloadPacket.class, ClientboundCustomPayloadPacket::new)
.addPacket(ClientboundDisconnectPacket.class, ClientboundDisconnectPacket::new)
.addPacket(ClientboundFinishConfigurationPacket.class, ClientboundFinishConfigurationPacket::new)
@@ -465,7 +465,7 @@ public enum ConnectionProtocol {
)
.addFlow(
PacketFlow.SERVERBOUND,
- new ConnectionProtocol.PacketSet<ServerCommonPacketListener>()
+ new ConnectionProtocol.PacketSet<net.minecraft.network.protocol.configuration.ServerConfigurationPacketListener>() // Paper - decompile fix
.addPacket(ServerboundClientInformationPacket.class, ServerboundClientInformationPacket::new)
.addPacket(ServerboundCustomPayloadPacket.class, ServerboundCustomPayloadPacket::new)
.addPacket(ServerboundFinishConfigurationPacket.class, ServerboundFinishConfigurationPacket::new)
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 62e096c9cc05c387ca2413a490f44c6c66a5c41e..9c23ad38f935b2f31c0e0998e685978434202900 100644 index 254e362cd54359512285bab632dbae3cec0f03e0..a3d44867e6243f30640df91a0285ed735a9f1f34 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1863,7 +1863,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1924,7 +1924,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
PackRepository resourcepackrepository = this.packRepository; PackRepository resourcepackrepository = this.packRepository;
Objects.requireNonNull(this.packRepository); Objects.requireNonNull(this.packRepository);
@ -106,16 +84,3 @@ index 661a6274a800ca9b91bdb809d026972d23c3b263..ea72dcb064a35bc6245bc5c94d592efe
} }
public static <T> SortedArraySet<T> create(Comparator<T> comparator) { public static <T> SortedArraySet<T> create(Comparator<T> comparator) {
diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
index 04adc10f24f96804a5cb14e884224bb672360464..4259181bab2dc4f2d0409b56fdf81d966003376d 100644
--- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
+++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
@@ -81,7 +81,7 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
}
this.recipes = (Map) map1.entrySet().stream().collect(ImmutableMap.toImmutableMap(Entry::getKey, (entry1) -> {
- return (entry1.getValue()); // CraftBukkit
+ return entry1.getValue(); // CraftBukkit // Paper - decompile fix - *shrugs internally* // todo: is this needed anymore?
}));
this.byName = Maps.newHashMap(builder.build()); // CraftBukkit
RecipeManager.LOGGER.info("Loaded {} recipes", map1.size());

Datei anzeigen

@ -17,10 +17,10 @@ Subject: [PATCH] CB fixes
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com> Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index aac9513ff4d3d494860bd06607cf8af5e466fd5b..30fc222c384938fb4fdd4c6715295aeea57094bc 100644 index cc5e1076bdf7b4794ee79934fb70234ba61efe15..b3caf69f9627ba2114dc9d06551ccf182debfb04 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -296,7 +296,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -302,7 +302,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
long l = minecraftserver.getWorldData().worldGenOptions().seed(); long l = minecraftserver.getWorldData().worldGenOptions().seed();
@ -30,21 +30,21 @@ index aac9513ff4d3d494860bd06607cf8af5e466fd5b..30fc222c384938fb4fdd4c6715295aee
if ((this.dimension() == Level.END && this.dimensionTypeRegistration().is(BuiltinDimensionTypes.END)) || env == org.bukkit.World.Environment.THE_END) { // CraftBukkit - Allow to create EnderDragonBattle in default and custom END if ((this.dimension() == Level.END && this.dimensionTypeRegistration().is(BuiltinDimensionTypes.END)) || env == org.bukkit.World.Environment.THE_END) { // CraftBukkit - Allow to create EnderDragonBattle in default and custom END
this.dragonFight = new EndDragonFight(this, this.serverLevelData.worldGenOptions().seed(), this.serverLevelData.endDragonFightData()); // CraftBukkit this.dragonFight = new EndDragonFight(this, this.serverLevelData.worldGenOptions().seed(), this.serverLevelData.endDragonFightData()); // CraftBukkit
diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
index b2f37e3caf305f7f2c19c59848717bf73bd2ef5d..87c8460324ff2d2a14e1404fcfa3adb2d336a089 100644 index 85e0a68d85fe62df19ad9809b1869a3eee6d5465..09aa76ec6f89163c1221721008ccb541eaf420ca 100644
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java --- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java +++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
@@ -462,15 +462,9 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl @@ -451,15 +451,9 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl
} }
@Override @Override
- // CraftBukkit start - void -> boolean - // CraftBukkit start - void -> boolean
- protected boolean actuallyHurt(DamageSource damagesource, float f) { - public boolean actuallyHurt(DamageSource damagesource, float f) {
- boolean hurt = super.actuallyHurt(damagesource, f); - boolean hurt = super.actuallyHurt(damagesource, f);
- if (!hurt) { - if (!hurt) {
- return hurt; - return hurt;
- } - }
- // CraftBukkit end - // CraftBukkit end
+ protected boolean actuallyHurt(DamageSource damagesource, float f) { // Paper - change return type to boolean + public boolean actuallyHurt(DamageSource damagesource, float f) { // Paper - change return type to boolean
this.standUpInstantly(); this.standUpInstantly();
- return hurt; // CraftBukkit - return hurt; // CraftBukkit
+ return super.actuallyHurt(damagesource, f); // Paper - change return type to boolean + return super.actuallyHurt(damagesource, f); // Paper - change return type to boolean
@ -52,19 +52,19 @@ index b2f37e3caf305f7f2c19c59848717bf73bd2ef5d..87c8460324ff2d2a14e1404fcfa3adb2
@Override @Override
diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java b/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java b/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java
index 3f5bedc49f249888cf435f5511f5ce1da921910b..a63eaec77251a7f6660d17d7210c639b71751c45 100644 index 0dc7f88877020bddd5a84db51d349f52b673048e..aae73586265593ee7830fb8dd5c2e3d7560057f0 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java --- a/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java +++ b/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java
@@ -42,7 +42,7 @@ public class StructureCheck { @@ -40,7 +40,7 @@ public class StructureCheck {
private final Registry<Biome> biomes; private final ChunkScanAccess storageAccess;
private final Registry<Structure> structureConfigs; private final RegistryAccess registryAccess;
private final StructureTemplateManager structureTemplateManager; private final StructureTemplateManager structureTemplateManager;
- private final ResourceKey<Level> dimension; - private final ResourceKey<Level> dimension;
+ private final ResourceKey<net.minecraft.world.level.dimension.LevelStem> dimension; // Paper - fix missing CB diff + private final ResourceKey<net.minecraft.world.level.dimension.LevelStem> dimension; // Paper - fix missing CB diff
private final ChunkGenerator chunkGenerator; private final ChunkGenerator chunkGenerator;
private final RandomState randomState; private final RandomState randomState;
private final LevelHeightAccessor heightAccessor; private final LevelHeightAccessor heightAccessor;
@@ -56,7 +56,7 @@ public class StructureCheck { @@ -54,7 +54,7 @@ public class StructureCheck {
ChunkScanAccess chunkIoWorker, ChunkScanAccess chunkIoWorker,
RegistryAccess registryManager, RegistryAccess registryManager,
StructureTemplateManager structureTemplateManager, StructureTemplateManager structureTemplateManager,
@ -74,10 +74,10 @@ index 3f5bedc49f249888cf435f5511f5ce1da921910b..a63eaec77251a7f6660d17d7210c639b
RandomState noiseConfig, RandomState noiseConfig,
LevelHeightAccessor world, LevelHeightAccessor world,
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftLootTable.java b/src/main/java/org/bukkit/craftbukkit/CraftLootTable.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftLootTable.java b/src/main/java/org/bukkit/craftbukkit/CraftLootTable.java
index 809fdf2da78293391aa5c60c04f4ad652b152eec..955b0abd4019fc45df84719eee6bf413e59d941a 100644 index 9b90649f71849b3830ca9b6a3c5a722c66b02f1f..209c6b64e79c29ea3bb84ddbe89a8bff66f81d0f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftLootTable.java --- a/src/main/java/org/bukkit/craftbukkit/CraftLootTable.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftLootTable.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftLootTable.java
@@ -172,4 +172,11 @@ public class CraftLootTable implements org.bukkit.loot.LootTable { @@ -197,4 +197,11 @@ public class CraftLootTable implements org.bukkit.loot.LootTable {
org.bukkit.loot.LootTable table = (org.bukkit.loot.LootTable) obj; org.bukkit.loot.LootTable table = (org.bukkit.loot.LootTable) obj;
return table.getKey().equals(this.getKey()); return table.getKey().equals(this.getKey());
} }
@ -90,30 +90,32 @@ index 809fdf2da78293391aa5c60c04f4ad652b152eec..955b0abd4019fc45df84719eee6bf413
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index cd39509d383c47319b71797e5d1df41c2b8c7ab6..2cc1871c81056acd0582184bb684e672d14d3b6f 100644 index 02ddd4e200a86d720297dbec508480fc0cd270d1..080c0cf84d959e1acdde088f367bd005ea9c3bbd 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2466,7 +2466,11 @@ public final class CraftServer implements Server { @@ -2482,7 +2482,13 @@ public final class CraftServer implements Server {
Preconditions.checkArgument(key != null, "NamespacedKey key cannot be null"); Preconditions.checkArgument(key != null, "NamespacedKey key cannot be null");
LootDataManager registry = this.getServer().getLootData(); ReloadableServerRegistries.Holder registry = this.getServer().reloadableRegistries();
- return new CraftLootTable(key, registry.getLootTable(CraftNamespacedKey.toMinecraft(key))); - return new CraftLootTable(key, registry.getLootTable(CraftLootTable.bukkitKeyToMinecraft(key)));
+ // Paper start - honor method contract + // Paper start - honor method contract
+ final ResourceLocation lootTableKey = CraftNamespacedKey.toMinecraft(key); + final ResourceKey<net.minecraft.world.level.storage.loot.LootTable> lootTableKey = CraftLootTable.bukkitKeyToMinecraft(key);
+ final Optional<net.minecraft.world.level.storage.loot.LootTable> table = registry.getElementOptional(net.minecraft.world.level.storage.loot.LootDataType.TABLE, lootTableKey); + final Optional<net.minecraft.world.level.storage.loot.LootTable> table = registry.get().lookup(Registries.LOOT_TABLE)
+ .flatMap(registryEntryLookup -> registryEntryLookup.get(lootTableKey))
+ .map(net.minecraft.core.Holder::value);
+ return table.map(lootTable -> new CraftLootTable(key, lootTable)).orElse(null); + return table.map(lootTable -> new CraftLootTable(key, lootTable)).orElse(null);
+ // Paper end + // Paper end
} }
@Override @Override
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index cc6d96c5015b4e5614e8091dc9113e82e9babc25..6f9196120177104c6e689ff1d39a06f91d04b0c8 100644 index 1e3ca7ca98abfd5be233a7eeb6dad201776d2d6a..9ec50bbb262b25fea157ae48e8395f5cd38f8906 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java --- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -122,6 +122,7 @@ public class Main { @@ -123,6 +123,7 @@ public class Main {
this.acceptsAll(Main.asList("forceUpgrade"), "Whether to force a world upgrade"); this.acceptsAll(Main.asList("forceUpgrade"), "Whether to force a world upgrade");
this.acceptsAll(Main.asList("eraseCache"), "Whether to force cache erase during world upgrade"); this.acceptsAll(Main.asList("eraseCache"), "Whether to force cache erase during world upgrade");
this.acceptsAll(Main.asList("recreateRegionFiles"), "Whether to recreate region files during world upgrade");
+ this.accepts("safeMode", "Loads level with vanilla datapack only"); // Paper + this.accepts("safeMode", "Loads level with vanilla datapack only"); // Paper
this.acceptsAll(Main.asList("nogui"), "Disables the graphical console"); this.acceptsAll(Main.asList("nogui"), "Disables the graphical console");

Datei anzeigen

@ -5937,10 +5937,10 @@ index 0000000000000000000000000000000000000000..d603887f4d0464f4463172fd79bcd529
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
index 3d4c889aa278f814f3af0af62fd38db4f1f05a45..bf17c2005aa71a627c93b3bbaa773a5902b897c1 100644 index 2014fdb15c31b8d5ec520f9a39c973972ceb6060..9d91e7890d8cba72f0aa2ca9661f6de7ae8a0dcd 100644
--- a/src/main/java/net/minecraft/Util.java --- a/src/main/java/net/minecraft/Util.java
+++ b/src/main/java/net/minecraft/Util.java +++ b/src/main/java/net/minecraft/Util.java
@@ -127,7 +127,7 @@ public class Util { @@ -133,7 +133,7 @@ public class Util {
} }
public static long getNanos() { public static long getNanos() {
@ -5950,7 +5950,7 @@ index 3d4c889aa278f814f3af0af62fd38db4f1f05a45..bf17c2005aa71a627c93b3bbaa773a59
public static long getEpochMillis() { public static long getEpochMillis() {
diff --git a/src/main/java/net/minecraft/nbt/CompoundTag.java b/src/main/java/net/minecraft/nbt/CompoundTag.java diff --git a/src/main/java/net/minecraft/nbt/CompoundTag.java b/src/main/java/net/minecraft/nbt/CompoundTag.java
index 557702f85573da753d68fcba76dde7c74de9d12b..1e2f58f2f95c558ce28706c405050c4c5701dd40 100644 index 6b588a4e639da11edeb933ec2bc4afde8f0b47f1..1cbc42c44911b71dfadebc2d60e0e5cb9b6cafe6 100644
--- a/src/main/java/net/minecraft/nbt/CompoundTag.java --- a/src/main/java/net/minecraft/nbt/CompoundTag.java
+++ b/src/main/java/net/minecraft/nbt/CompoundTag.java +++ b/src/main/java/net/minecraft/nbt/CompoundTag.java
@@ -159,7 +159,7 @@ public class CompoundTag implements Tag { @@ -159,7 +159,7 @@ public class CompoundTag implements Tag {
@ -5974,10 +5974,10 @@ index 557702f85573da753d68fcba76dde7c74de9d12b..1e2f58f2f95c558ce28706c405050c4c
return NbtUtils.loadUUID(this.get(key)); return NbtUtils.loadUUID(this.get(key));
} }
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index e7a124403f2b07c96caaaf97d1c9023f9ec2f9d9..5b267514504497de3faa7ffa490a179200d9415c 100644 index 7de2bf05e9ab33ded7a6c49efe5e35a232153c2e..256a983c7345902600d52d7b7e3056162275f4c7 100644
--- a/src/main/java/net/minecraft/network/Connection.java --- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java
@@ -112,6 +112,18 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -121,6 +121,18 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
BandwidthDebugMonitor bandwidthDebugMonitor; BandwidthDebugMonitor bandwidthDebugMonitor;
public String hostname = ""; // CraftBukkit - add field public String hostname = ""; // CraftBukkit - add field
@ -5997,23 +5997,23 @@ index e7a124403f2b07c96caaaf97d1c9023f9ec2f9d9..5b267514504497de3faa7ffa490a1792
this.receiving = side; this.receiving = side;
} }
diff --git a/src/main/java/net/minecraft/network/PacketEncoder.java b/src/main/java/net/minecraft/network/PacketEncoder.java diff --git a/src/main/java/net/minecraft/network/PacketEncoder.java b/src/main/java/net/minecraft/network/PacketEncoder.java
index 522c62ff1114fa8bff41f7177f1192ab4472a6ed..d0e159f54da70bf0bd834738ced5d4b414a36142 100644 index e82263b4b48c4544a5ade6613ea284f4de2b4c80..a58f67973b4ed986065860263c7a42214640520d 100644
--- a/src/main/java/net/minecraft/network/PacketEncoder.java --- a/src/main/java/net/minecraft/network/PacketEncoder.java
+++ b/src/main/java/net/minecraft/network/PacketEncoder.java +++ b/src/main/java/net/minecraft/network/PacketEncoder.java
@@ -46,7 +46,7 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> { @@ -31,7 +31,7 @@ public class PacketEncoder<T extends PacketListener> extends MessageToByteEncode
JvmProfiler.INSTANCE.onPacketSent(codecData.protocol(), i, channelHandlerContext.channel().remoteAddress(), k); JvmProfiler.INSTANCE.onPacketSent(this.protocolInfo.id(), packetType, channelHandlerContext.channel().remoteAddress(), i);
} catch (Throwable var13) { } catch (Throwable var9) {
- LOGGER.error("Error receiving packet {}", i, var13); - LOGGER.error("Error sending packet {}", packetType, var9);
+ LOGGER.error("Packet encoding of packet ID {} threw (skippable? {})", i, packet.isSkippable(), var13); // Paper - Give proper error message + LOGGER.error("Error sending packet {} (skippable? {})", packetType, packet.isSkippable(), var9);
if (packet.isSkippable()) { if (packet.isSkippable()) {
throw new SkipPacketException(var13); throw new SkipPacketException(var9);
} }
diff --git a/src/main/java/net/minecraft/network/protocol/login/ClientboundCustomQueryPacket.java b/src/main/java/net/minecraft/network/protocol/login/ClientboundCustomQueryPacket.java diff --git a/src/main/java/net/minecraft/network/protocol/login/ClientboundCustomQueryPacket.java b/src/main/java/net/minecraft/network/protocol/login/ClientboundCustomQueryPacket.java
index 929d31aa624f035eb314dece08969b102f5781fc..e94f0361cbca873f05b5b768c68c0933a0ca4483 100644 index e113cd9d93750cf59712b06db62591876b4efbac..1789c0c71d968b386060bd6dc2630e8a078c32e2 100644
--- a/src/main/java/net/minecraft/network/protocol/login/ClientboundCustomQueryPacket.java --- a/src/main/java/net/minecraft/network/protocol/login/ClientboundCustomQueryPacket.java
+++ b/src/main/java/net/minecraft/network/protocol/login/ClientboundCustomQueryPacket.java +++ b/src/main/java/net/minecraft/network/protocol/login/ClientboundCustomQueryPacket.java
@@ -38,4 +38,14 @@ public record ClientboundCustomQueryPacket(int transactionId, CustomQueryPayload @@ -47,4 +47,14 @@ public record ClientboundCustomQueryPacket(int transactionId, CustomQueryPayload
public void handle(ClientLoginPacketListener listener) { public void handle(ClientLoginPacketListener listener) {
listener.handleCustomQuery(this); listener.handleCustomQuery(this);
} }
@ -6029,10 +6029,10 @@ index 929d31aa624f035eb314dece08969b102f5781fc..e94f0361cbca873f05b5b768c68c0933
+ // Paper end - MC Utils - default query payloads + // Paper end - MC Utils - default query payloads
} }
diff --git a/src/main/java/net/minecraft/network/protocol/login/ServerboundCustomQueryAnswerPacket.java b/src/main/java/net/minecraft/network/protocol/login/ServerboundCustomQueryAnswerPacket.java diff --git a/src/main/java/net/minecraft/network/protocol/login/ServerboundCustomQueryAnswerPacket.java b/src/main/java/net/minecraft/network/protocol/login/ServerboundCustomQueryAnswerPacket.java
index 3ad2f40a7a1a8878290c5efd3e032572daf0b558..bcc4cd142c22e8d6957a329719353d789b826a69 100644 index 3e5a85a7ad6149b04622c254fbc2e174896a4128..3f662692ed4846e026a9d48595e7b3b22404a031 100644
--- a/src/main/java/net/minecraft/network/protocol/login/ServerboundCustomQueryAnswerPacket.java --- a/src/main/java/net/minecraft/network/protocol/login/ServerboundCustomQueryAnswerPacket.java
+++ b/src/main/java/net/minecraft/network/protocol/login/ServerboundCustomQueryAnswerPacket.java +++ b/src/main/java/net/minecraft/network/protocol/login/ServerboundCustomQueryAnswerPacket.java
@@ -15,7 +15,17 @@ public record ServerboundCustomQueryAnswerPacket(int transactionId, @Nullable Cu @@ -20,7 +20,17 @@ public record ServerboundCustomQueryAnswerPacket(int transactionId, @Nullable Cu
} }
private static CustomQueryAnswerPayload readPayload(int queryId, FriendlyByteBuf buf) { private static CustomQueryAnswerPayload readPayload(int queryId, FriendlyByteBuf buf) {
@ -6051,7 +6051,7 @@ index 3ad2f40a7a1a8878290c5efd3e032572daf0b558..bcc4cd142c22e8d6957a329719353d78
} }
private static CustomQueryAnswerPayload readUnknownPayload(FriendlyByteBuf buf) { private static CustomQueryAnswerPayload readUnknownPayload(FriendlyByteBuf buf) {
@@ -38,4 +48,21 @@ public record ServerboundCustomQueryAnswerPacket(int transactionId, @Nullable Cu @@ -47,4 +57,21 @@ public record ServerboundCustomQueryAnswerPacket(int transactionId, @Nullable Cu
public void handle(ServerLoginPacketListener listener) { public void handle(ServerLoginPacketListener listener) {
listener.handleCustomQueryPacket(this); listener.handleCustomQueryPacket(this);
} }
@ -6074,10 +6074,10 @@ index 3ad2f40a7a1a8878290c5efd3e032572daf0b558..bcc4cd142c22e8d6957a329719353d78
+ +
} }
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 9c23ad38f935b2f31c0e0998e685978434202900..4035faedd9f5f72f262822a9f050178d99be06e4 100644 index a3d44867e6243f30640df91a0285ed735a9f1f34..be9fde876cb22296afd01fb5d55be1f1e9f78407 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -296,6 +296,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -303,6 +303,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public final double[] recentTps = new double[ 3 ]; public final double[] recentTps = new double[ 3 ];
// Spigot end // Spigot end
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations; // Paper - add paper configuration files public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations; // Paper - add paper configuration files
@ -6085,7 +6085,7 @@ index 9c23ad38f935b2f31c0e0998e685978434202900..4035faedd9f5f72f262822a9f050178d
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) { public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference(); AtomicReference<S> atomicreference = new AtomicReference();
@@ -956,6 +957,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -966,6 +967,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
MinecraftServer.LOGGER.error("Failed to unlock level {}", this.storageSource.getLevelId(), ioexception1); MinecraftServer.LOGGER.error("Failed to unlock level {}", this.storageSource.getLevelId(), ioexception1);
} }
// Spigot start // Spigot start
@ -6095,7 +6095,7 @@ index 9c23ad38f935b2f31c0e0998e685978434202900..4035faedd9f5f72f262822a9f050178d
if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) { if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) {
MinecraftServer.LOGGER.info("Saving usercache.json"); MinecraftServer.LOGGER.info("Saving usercache.json");
this.getProfileCache().save(); this.getProfileCache().save();
@@ -1029,6 +1033,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1039,6 +1043,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
} }
// Spigot start // Spigot start
@ -6103,7 +6103,7 @@ index 9c23ad38f935b2f31c0e0998e685978434202900..4035faedd9f5f72f262822a9f050178d
if ( tickCount++ % MinecraftServer.SAMPLE_INTERVAL == 0 ) if ( tickCount++ % MinecraftServer.SAMPLE_INTERVAL == 0 )
{ {
long curTime = Util.getMillis(); long curTime = Util.getMillis();
@@ -1258,7 +1263,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1309,7 +1314,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
MinecraftServer.LOGGER.debug("Autosave finished"); MinecraftServer.LOGGER.debug("Autosave finished");
SpigotTimings.worldSaveTimer.stopTiming(); // Spigot SpigotTimings.worldSaveTimer.stopTiming(); // Spigot
} }
@ -6112,7 +6112,7 @@ index 9c23ad38f935b2f31c0e0998e685978434202900..4035faedd9f5f72f262822a9f050178d
this.profiler.push("tallying"); this.profiler.push("tallying");
long j = Util.getNanos() - i; long j = Util.getNanos() - i;
int k = this.tickCount % 100; int k = this.tickCount % 100;
@@ -1382,6 +1387,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1442,6 +1447,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
try { try {
worldserver.timings.doTick.startTiming(); // Spigot worldserver.timings.doTick.startTiming(); // Spigot
worldserver.tick(shouldKeepTicking); worldserver.tick(shouldKeepTicking);
@ -6125,23 +6125,23 @@ index 9c23ad38f935b2f31c0e0998e685978434202900..4035faedd9f5f72f262822a9f050178d
} catch (Throwable throwable) { } catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world"); CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
index 1641bdf8725df778ba91bf5cd22c1ebbb3745058..facfdbb87e89f4db33ce13233c2ba4366d35c15b 100644 index 2119fc6f72461199ae8969ab0d9b8fab26d775a8..05f761913bc0c65f2b8ada5f90e322e139518173 100644
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java --- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java +++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
@@ -50,9 +50,9 @@ public class ChunkHolder { @@ -48,9 +48,9 @@ public class ChunkHolder {
private static final List<ChunkStatus> CHUNK_STATUSES = ChunkStatus.getStatusList(); private static final List<ChunkStatus> CHUNK_STATUSES = ChunkStatus.getStatusList();
private final AtomicReferenceArray<CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>>> futures; private final AtomicReferenceArray<CompletableFuture<ChunkResult<ChunkAccess>>> futures;
private final LevelHeightAccessor levelHeightAccessor; private final LevelHeightAccessor levelHeightAccessor;
- private volatile CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> fullChunkFuture; - private volatile CompletableFuture<ChunkResult<LevelChunk>> fullChunkFuture;
- private volatile CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> tickingChunkFuture; - private volatile CompletableFuture<ChunkResult<LevelChunk>> tickingChunkFuture;
- private volatile CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> entityTickingChunkFuture; - private volatile CompletableFuture<ChunkResult<LevelChunk>> entityTickingChunkFuture;
+ private volatile CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> fullChunkFuture; private int fullChunkCreateCount; private volatile boolean isFullChunkReady; // Paper - cache chunk ticking stage + private volatile CompletableFuture<ChunkResult<LevelChunk>> fullChunkFuture; private int fullChunkCreateCount; private volatile boolean isFullChunkReady; // Paper - cache chunk ticking stage
+ private volatile CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> tickingChunkFuture; private volatile boolean isTickingReady; // Paper - cache chunk ticking stage + private volatile CompletableFuture<ChunkResult<LevelChunk>> tickingChunkFuture; private volatile boolean isTickingReady; // Paper - cache chunk ticking stage
+ private volatile CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> entityTickingChunkFuture; private volatile boolean isEntityTickingReady; // Paper - cache chunk ticking stage + private volatile CompletableFuture<ChunkResult<LevelChunk>> entityTickingChunkFuture; private volatile boolean isEntityTickingReady; // Paper - cache chunk ticking stage
private CompletableFuture<ChunkAccess> chunkToSave; private CompletableFuture<ChunkAccess> chunkToSave;
@Nullable @Nullable
private final DebugBuffer<ChunkHolder.ChunkSaveDebug> chunkToSaveHistory; private final DebugBuffer<ChunkHolder.ChunkSaveDebug> chunkToSaveHistory;
@@ -71,6 +71,18 @@ public class ChunkHolder { @@ -69,6 +69,18 @@ public class ChunkHolder {
private CompletableFuture<Void> pendingFullStateConfirmation; private CompletableFuture<Void> pendingFullStateConfirmation;
private CompletableFuture<?> sendSync; private CompletableFuture<?> sendSync;
@ -6160,7 +6160,7 @@ index 1641bdf8725df778ba91bf5cd22c1ebbb3745058..facfdbb87e89f4db33ce13233c2ba436
public ChunkHolder(ChunkPos pos, int level, LevelHeightAccessor world, LevelLightEngine lightingProvider, ChunkHolder.LevelChangeListener levelUpdateListener, ChunkHolder.PlayerProvider playersWatchingChunkProvider) { public ChunkHolder(ChunkPos pos, int level, LevelHeightAccessor world, LevelLightEngine lightingProvider, ChunkHolder.LevelChangeListener levelUpdateListener, ChunkHolder.PlayerProvider playersWatchingChunkProvider) {
this.futures = new AtomicReferenceArray(ChunkHolder.CHUNK_STATUSES.size()); this.futures = new AtomicReferenceArray(ChunkHolder.CHUNK_STATUSES.size());
this.fullChunkFuture = ChunkHolder.UNLOADED_LEVEL_CHUNK_FUTURE; this.fullChunkFuture = ChunkHolder.UNLOADED_LEVEL_CHUNK_FUTURE;
@@ -92,8 +104,23 @@ public class ChunkHolder { @@ -90,8 +102,23 @@ public class ChunkHolder {
this.queueLevel = this.oldTicketLevel; this.queueLevel = this.oldTicketLevel;
this.setTicketLevel(level); this.setTicketLevel(level);
this.changedBlocksPerSection = new ShortSet[world.getSectionsCount()]; this.changedBlocksPerSection = new ShortSet[world.getSectionsCount()];
@ -6184,41 +6184,32 @@ index 1641bdf8725df778ba91bf5cd22c1ebbb3745058..facfdbb87e89f4db33ce13233c2ba436
// CraftBukkit start // CraftBukkit start
public LevelChunk getFullChunkNow() { public LevelChunk getFullChunkNow() {
// Note: We use the oldTicketLevel for isLoaded checks. // Note: We use the oldTicketLevel for isLoaded checks.
@@ -118,20 +145,20 @@ public class ChunkHolder { @@ -116,20 +143,20 @@ public class ChunkHolder {
return ChunkLevel.generationStatus(this.ticketLevel).isOrAfter(leastStatus) ? this.getFutureIfPresentUnchecked(leastStatus) : ChunkHolder.UNLOADED_CHUNK_FUTURE; return ChunkLevel.generationStatus(this.ticketLevel).isOrAfter(leastStatus) ? this.getFutureIfPresentUnchecked(leastStatus) : ChunkHolder.UNLOADED_CHUNK_FUTURE;
} }
- public CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> getTickingChunkFuture() { - public CompletableFuture<ChunkResult<LevelChunk>> getTickingChunkFuture() {
+ public final CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> getTickingChunkFuture() { // Paper - final for inline + public final CompletableFuture<ChunkResult<LevelChunk>> getTickingChunkFuture() { // Paper - final for inline
return this.tickingChunkFuture; return this.tickingChunkFuture;
} }
- public CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> getEntityTickingChunkFuture() { - public CompletableFuture<ChunkResult<LevelChunk>> getEntityTickingChunkFuture() {
+ public final CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> getEntityTickingChunkFuture() { // Paper - final for inline + public final CompletableFuture<ChunkResult<LevelChunk>> getEntityTickingChunkFuture() { // Paper - final for inline
return this.entityTickingChunkFuture; return this.entityTickingChunkFuture;
} }
- public CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> getFullChunkFuture() { - public CompletableFuture<ChunkResult<LevelChunk>> getFullChunkFuture() {
+ public final CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> getFullChunkFuture() { // Paper - final for inline + public final CompletableFuture<ChunkResult<LevelChunk>> getFullChunkFuture() { // Paper - final for inline
return this.fullChunkFuture; return this.fullChunkFuture;
} }
@Nullable @Nullable
- public LevelChunk getTickingChunk() { - public LevelChunk getTickingChunk() {
+ public final LevelChunk getTickingChunk() { // Paper - final for inline + public final LevelChunk getTickingChunk() { // Paper - final for inline
CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> completablefuture = this.getTickingChunkFuture(); return (LevelChunk) ((ChunkResult) this.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).orElse(null); // CraftBukkit - decompile error
Either<LevelChunk, ChunkHolder.ChunkLoadingFailure> either = (Either) completablefuture.getNow(null); // CraftBukkit - decompile error
@@ -148,7 +175,7 @@ public class ChunkHolder {
} }
@Nullable @@ -156,6 +183,21 @@ public class ChunkHolder {
- public LevelChunk getFullChunk() {
+ public final LevelChunk getFullChunk() { // Paper - final for inline
CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> completablefuture = this.getFullChunkFuture();
Either<LevelChunk, ChunkHolder.ChunkLoadingFailure> either = (Either) completablefuture.getNow(null); // CraftBukkit - decompile error
@@ -169,6 +196,21 @@ public class ChunkHolder {
return null; return null;
} }
@ -6240,7 +6231,7 @@ index 1641bdf8725df778ba91bf5cd22c1ebbb3745058..facfdbb87e89f4db33ce13233c2ba436
@Nullable @Nullable
public ChunkAccess getLastAvailable() { public ChunkAccess getLastAvailable() {
for (int i = ChunkHolder.CHUNK_STATUSES.size() - 1; i >= 0; --i) { for (int i = ChunkHolder.CHUNK_STATUSES.size() - 1; i >= 0; --i) {
@@ -187,7 +229,7 @@ public class ChunkHolder { @@ -174,7 +216,7 @@ public class ChunkHolder {
return null; return null;
} }
@ -6249,7 +6240,7 @@ index 1641bdf8725df778ba91bf5cd22c1ebbb3745058..facfdbb87e89f4db33ce13233c2ba436
return this.chunkToSave; return this.chunkToSave;
} }
@@ -386,11 +428,11 @@ public class ChunkHolder { @@ -366,11 +408,11 @@ public class ChunkHolder {
return ChunkLevel.fullStatus(this.ticketLevel); return ChunkLevel.fullStatus(this.ticketLevel);
} }
@ -6263,7 +6254,7 @@ index 1641bdf8725df778ba91bf5cd22c1ebbb3745058..facfdbb87e89f4db33ce13233c2ba436
return this.ticketLevel; return this.ticketLevel;
} }
@@ -479,14 +521,31 @@ public class ChunkHolder { @@ -457,14 +499,31 @@ public class ChunkHolder {
this.wasAccessibleSinceLastSave |= flag3; this.wasAccessibleSinceLastSave |= flag3;
if (!flag2 && flag3) { if (!flag2 && flag3) {
@ -6295,7 +6286,7 @@ index 1641bdf8725df778ba91bf5cd22c1ebbb3745058..facfdbb87e89f4db33ce13233c2ba436
} }
boolean flag4 = fullchunkstatus.isOrAfter(FullChunkStatus.BLOCK_TICKING); boolean flag4 = fullchunkstatus.isOrAfter(FullChunkStatus.BLOCK_TICKING);
@@ -495,11 +554,25 @@ public class ChunkHolder { @@ -473,11 +532,25 @@ public class ChunkHolder {
if (!flag4 && flag5) { if (!flag4 && flag5) {
this.tickingChunkFuture = chunkStorage.prepareTickingChunk(this); this.tickingChunkFuture = chunkStorage.prepareTickingChunk(this);
this.scheduleFullChunkPromotion(chunkStorage, this.tickingChunkFuture, executor, FullChunkStatus.BLOCK_TICKING); this.scheduleFullChunkPromotion(chunkStorage, this.tickingChunkFuture, executor, FullChunkStatus.BLOCK_TICKING);
@ -6322,7 +6313,7 @@ index 1641bdf8725df778ba91bf5cd22c1ebbb3745058..facfdbb87e89f4db33ce13233c2ba436
this.tickingChunkFuture = ChunkHolder.UNLOADED_LEVEL_CHUNK_FUTURE; this.tickingChunkFuture = ChunkHolder.UNLOADED_LEVEL_CHUNK_FUTURE;
} }
@@ -513,11 +586,24 @@ public class ChunkHolder { @@ -491,11 +564,24 @@ public class ChunkHolder {
this.entityTickingChunkFuture = chunkStorage.prepareEntityTickingChunk(this); this.entityTickingChunkFuture = chunkStorage.prepareEntityTickingChunk(this);
this.scheduleFullChunkPromotion(chunkStorage, this.entityTickingChunkFuture, executor, FullChunkStatus.ENTITY_TICKING); this.scheduleFullChunkPromotion(chunkStorage, this.entityTickingChunkFuture, executor, FullChunkStatus.ENTITY_TICKING);
@ -6348,9 +6339,9 @@ index 1641bdf8725df778ba91bf5cd22c1ebbb3745058..facfdbb87e89f4db33ce13233c2ba436
this.entityTickingChunkFuture = ChunkHolder.UNLOADED_LEVEL_CHUNK_FUTURE; this.entityTickingChunkFuture = ChunkHolder.UNLOADED_LEVEL_CHUNK_FUTURE;
} }
@@ -615,4 +701,18 @@ public class ChunkHolder { @@ -575,4 +661,18 @@ public class ChunkHolder {
} private static record ChunkSaveDebug(Thread thread, CompletableFuture<?> future, String source) {
};
} }
+ +
+ // Paper start + // Paper start
@ -6368,10 +6359,10 @@ index 1641bdf8725df778ba91bf5cd22c1ebbb3745058..facfdbb87e89f4db33ce13233c2ba436
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 37527f5cb6e96410a5679b8b27f763727afc8657..8908511590adab6025ff02928591aa3cce4e480e 100644 index 3c0bb7319858fedccee658ea48a25e0ea635dc3c..3eb7dfd79cdf2824b2155d02d1b4c91bab3c7b33 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -168,6 +168,62 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -171,6 +171,62 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}; };
// CraftBukkit end // CraftBukkit end
@ -6432,12 +6423,12 @@ index 37527f5cb6e96410a5679b8b27f763727afc8657..8908511590adab6025ff02928591aa3c
+ // Paper end + // Paper end
+ +
public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureTemplateManager structureTemplateManager, Executor executor, BlockableEventLoop<Runnable> mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory, int viewDistance, boolean dsync) { public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureTemplateManager structureTemplateManager, Executor executor, BlockableEventLoop<Runnable> mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory, int viewDistance, boolean dsync) {
super(session.getDimensionPath(world.dimension()).resolve("region"), dataFixer, dsync); super(new RegionStorageInfo(session.getLevelId(), world.dimension(), "chunk"), session.getDimensionPath(world.dimension()).resolve("region"), dataFixer, dsync);
this.visibleChunkMap = this.updatingChunkMap.clone(); this.visibleChunkMap = this.updatingChunkMap.clone();
@@ -221,7 +277,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -222,7 +278,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.overworldDataStorage = persistentStateManagerFactory; this.poiManager = new PoiManager(new RegionStorageInfo(session.getLevelId(), world.dimension(), "poi"), path.resolve("poi"), dataFixer, dsync, iregistrycustom, world);
this.poiManager = new PoiManager(path.resolve("poi"), dataFixer, dsync, iregistrycustom, world);
this.setServerViewDistance(viewDistance); this.setServerViewDistance(viewDistance);
this.worldGenContext = new WorldGenContext(world, chunkGenerator, structureTemplateManager, this.lightEngine);
+ // Paper start + // Paper start
+ this.dataRegionManager = new io.papermc.paper.chunk.SingleThreadChunkRegionManager(this.level, 2, (1.0 / 3.0), 1, 6, "Data", DataRegionData::new, DataRegionSectionData::new); + this.dataRegionManager = new io.papermc.paper.chunk.SingleThreadChunkRegionManager(this.level, 2, (1.0 / 3.0), 1, 6, "Data", DataRegionData::new, DataRegionSectionData::new);
+ this.regionManagers.add(this.dataRegionManager); + this.regionManagers.add(this.dataRegionManager);
@ -6454,7 +6445,7 @@ index 37527f5cb6e96410a5679b8b27f763727afc8657..8908511590adab6025ff02928591aa3c
protected ChunkGenerator generator() { protected ChunkGenerator generator() {
return this.generator; return this.generator;
@@ -246,6 +314,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -248,6 +316,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}); });
} }
@ -6465,7 +6456,7 @@ index 37527f5cb6e96410a5679b8b27f763727afc8657..8908511590adab6025ff02928591aa3c
private static double euclideanDistanceSquared(ChunkPos pos, Entity entity) { private static double euclideanDistanceSquared(ChunkPos pos, Entity entity) {
double d0 = (double) SectionPos.sectionToBlockCoord(pos.x, 8); double d0 = (double) SectionPos.sectionToBlockCoord(pos.x, 8);
double d1 = (double) SectionPos.sectionToBlockCoord(pos.z, 8); double d1 = (double) SectionPos.sectionToBlockCoord(pos.z, 8);
@@ -418,9 +490,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -416,9 +488,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}; };
stringbuilder.append("Updating:").append(System.lineSeparator()); stringbuilder.append("Updating:").append(System.lineSeparator());
@ -6477,7 +6468,7 @@ index 37527f5cb6e96410a5679b8b27f763727afc8657..8908511590adab6025ff02928591aa3c
CrashReport crashreport = CrashReport.forThrowable(exception, "Chunk loading"); CrashReport crashreport = CrashReport.forThrowable(exception, "Chunk loading");
CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Chunk loading"); CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Chunk loading");
@@ -462,8 +534,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -460,8 +532,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
holder.setTicketLevel(level); holder.setTicketLevel(level);
} else { } else {
holder = new ChunkHolder(new ChunkPos(pos), level, this.level, this.lightEngine, this.queueSorter, this); holder = new ChunkHolder(new ChunkPos(pos), level, this.level, this.lightEngine, this.queueSorter, this);
@ -6492,7 +6483,7 @@ index 37527f5cb6e96410a5679b8b27f763727afc8657..8908511590adab6025ff02928591aa3c
this.updatingChunkMap.put(pos, holder); this.updatingChunkMap.put(pos, holder);
this.modified = true; this.modified = true;
} }
@@ -485,7 +563,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -483,7 +561,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
protected void saveAllChunks(boolean flush) { protected void saveAllChunks(boolean flush) {
if (flush) { if (flush) {
@ -6501,7 +6492,7 @@ index 37527f5cb6e96410a5679b8b27f763727afc8657..8908511590adab6025ff02928591aa3c
MutableBoolean mutableboolean = new MutableBoolean(); MutableBoolean mutableboolean = new MutableBoolean();
do { do {
@@ -514,7 +592,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -512,7 +590,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}); });
this.flushWorker(); this.flushWorker();
} else { } else {
@ -6510,7 +6501,7 @@ index 37527f5cb6e96410a5679b8b27f763727afc8657..8908511590adab6025ff02928591aa3c
} }
} }
@@ -533,7 +611,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -531,7 +609,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} }
public boolean hasWork() { public boolean hasWork() {
@ -6519,7 +6510,7 @@ index 37527f5cb6e96410a5679b8b27f763727afc8657..8908511590adab6025ff02928591aa3c
} }
private void processUnloads(BooleanSupplier shouldKeepTicking) { private void processUnloads(BooleanSupplier shouldKeepTicking) {
@@ -544,6 +622,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -542,6 +620,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
ChunkHolder playerchunk = (ChunkHolder) this.updatingChunkMap.remove(j); ChunkHolder playerchunk = (ChunkHolder) this.updatingChunkMap.remove(j);
if (playerchunk != null) { if (playerchunk != null) {
@ -6527,16 +6518,16 @@ index 37527f5cb6e96410a5679b8b27f763727afc8657..8908511590adab6025ff02928591aa3c
this.pendingUnloads.put(j, playerchunk); this.pendingUnloads.put(j, playerchunk);
this.modified = true; this.modified = true;
++i; ++i;
@@ -561,7 +640,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -559,7 +638,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} }
int l = 0; int l = 0;
- ObjectIterator objectiterator = this.visibleChunkMap.values().iterator(); - ObjectIterator<ChunkHolder> objectiterator = this.visibleChunkMap.values().iterator();
+ Iterator objectiterator = io.papermc.paper.chunk.system.ChunkSystem.getVisibleChunkHolders(this.level).iterator(); // Paper + Iterator<ChunkHolder> objectiterator = io.papermc.paper.chunk.system.ChunkSystem.getVisibleChunkHolders(this.level).iterator(); // Paper
while (l < 20 && shouldKeepTicking.getAsBoolean() && objectiterator.hasNext()) { while (l < 20 && shouldKeepTicking.getAsBoolean() && objectiterator.hasNext()) {
if (this.saveChunkIfNeeded((ChunkHolder) objectiterator.next())) { if (this.saveChunkIfNeeded((ChunkHolder) objectiterator.next())) {
@@ -579,7 +658,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -577,7 +656,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (completablefuture1 != completablefuture) { if (completablefuture1 != completablefuture) {
this.scheduleUnload(pos, holder); this.scheduleUnload(pos, holder);
} else { } else {
@ -6549,7 +6540,7 @@ index 37527f5cb6e96410a5679b8b27f763727afc8657..8908511590adab6025ff02928591aa3c
if (ichunkaccess instanceof LevelChunk) { if (ichunkaccess instanceof LevelChunk) {
((LevelChunk) ichunkaccess).setLoaded(false); ((LevelChunk) ichunkaccess).setLoaded(false);
} }
@@ -595,7 +678,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -593,7 +676,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.lightEngine.tryScheduleUpdate(); this.lightEngine.tryScheduleUpdate();
this.progressListener.onStatusChange(ichunkaccess.getPos(), (ChunkStatus) null); this.progressListener.onStatusChange(ichunkaccess.getPos(), (ChunkStatus) null);
this.chunkSaveCooldowns.remove(ichunkaccess.getPos().toLong()); this.chunkSaveCooldowns.remove(ichunkaccess.getPos().toLong());
@ -6560,7 +6551,7 @@ index 37527f5cb6e96410a5679b8b27f763727afc8657..8908511590adab6025ff02928591aa3c
} }
}; };
@@ -992,7 +1077,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1015,7 +1100,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} }
} }
@ -6569,7 +6560,7 @@ index 37527f5cb6e96410a5679b8b27f763727afc8657..8908511590adab6025ff02928591aa3c
int j = Mth.clamp(watchDistance, 2, 32); int j = Mth.clamp(watchDistance, 2, 32);
if (j != this.serverViewDistance) { if (j != this.serverViewDistance) {
@@ -1009,7 +1094,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1032,7 +1117,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} }
@ -6578,7 +6569,7 @@ index 37527f5cb6e96410a5679b8b27f763727afc8657..8908511590adab6025ff02928591aa3c
return Mth.clamp(player.requestedViewDistance(), 2, this.serverViewDistance); return Mth.clamp(player.requestedViewDistance(), 2, this.serverViewDistance);
} }
@@ -1038,7 +1123,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1061,7 +1146,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} }
public int size() { public int size() {
@ -6587,7 +6578,7 @@ index 37527f5cb6e96410a5679b8b27f763727afc8657..8908511590adab6025ff02928591aa3c
} }
public DistanceManager getDistanceManager() { public DistanceManager getDistanceManager() {
@@ -1046,19 +1131,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1069,19 +1154,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} }
protected Iterable<ChunkHolder> getChunks() { protected Iterable<ChunkHolder> getChunks() {
@ -6612,7 +6603,7 @@ index 37527f5cb6e96410a5679b8b27f763727afc8657..8908511590adab6025ff02928591aa3c
Optional<ChunkAccess> optional = Optional.ofNullable(playerchunk.getLastAvailable()); Optional<ChunkAccess> optional = Optional.ofNullable(playerchunk.getLastAvailable());
Optional<LevelChunk> optional1 = optional.flatMap((ichunkaccess) -> { Optional<LevelChunk> optional1 = optional.flatMap((ichunkaccess) -> {
return ichunkaccess instanceof LevelChunk ? Optional.of((LevelChunk) ichunkaccess) : Optional.empty(); return ichunkaccess instanceof LevelChunk ? Optional.of((LevelChunk) ichunkaccess) : Optional.empty();
@@ -1183,6 +1268,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1202,6 +1287,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
player.setChunkTrackingView(ChunkTrackingView.EMPTY); player.setChunkTrackingView(ChunkTrackingView.EMPTY);
this.updateChunkTracking(player); this.updateChunkTracking(player);
@ -6620,7 +6611,7 @@ index 37527f5cb6e96410a5679b8b27f763727afc8657..8908511590adab6025ff02928591aa3c
} else { } else {
SectionPos sectionposition = player.getLastSectionPos(); SectionPos sectionposition = player.getLastSectionPos();
@@ -1191,6 +1277,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1210,6 +1296,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.distanceManager.removePlayer(sectionposition, player); this.distanceManager.removePlayer(sectionposition, player);
} }
@ -6628,7 +6619,7 @@ index 37527f5cb6e96410a5679b8b27f763727afc8657..8908511590adab6025ff02928591aa3c
this.applyChunkTrackingView(player, ChunkTrackingView.EMPTY); this.applyChunkTrackingView(player, ChunkTrackingView.EMPTY);
} }
@@ -1242,6 +1329,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1261,6 +1348,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.updateChunkTracking(player); this.updateChunkTracking(player);
} }
@ -6636,24 +6627,24 @@ index 37527f5cb6e96410a5679b8b27f763727afc8657..8908511590adab6025ff02928591aa3c
} }
private void updateChunkTracking(ServerPlayer player) { private void updateChunkTracking(ServerPlayer player) {
@@ -1491,10 +1579,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1504,10 +1592,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}); });
} }
- private class ChunkDistanceManager extends DistanceManager { - private class ChunkDistanceManager extends DistanceManager {
+ public class ChunkDistanceManager extends DistanceManager { // Paper - public + public class ChunkDistanceManager extends DistanceManager { // Paper - public
protected ChunkDistanceManager(Executor workerExecutor, Executor mainThreadExecutor) { protected ChunkDistanceManager(final Executor workerExecutor, final Executor mainThreadExecutor) {
- super(workerExecutor, mainThreadExecutor); - super(workerExecutor, mainThreadExecutor);
+ super(workerExecutor, mainThreadExecutor, ChunkMap.this); + super(workerExecutor, mainThreadExecutor, ChunkMap.this); // Paper
} }
@Override @Override
diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java
index 2a805b9e67b7a05dda5f9caa4b63b28c940828d0..76005b3c48bfa323a77781c20c63708eeaa66b2b 100644 index 7a604df2cec802f7da78935647990fe8b575307b..e8640bcbc1d4e2965049974385585f5060cb6a44 100644
--- a/src/main/java/net/minecraft/server/level/DistanceManager.java --- a/src/main/java/net/minecraft/server/level/DistanceManager.java
+++ b/src/main/java/net/minecraft/server/level/DistanceManager.java +++ b/src/main/java/net/minecraft/server/level/DistanceManager.java
@@ -56,8 +56,9 @@ public abstract class DistanceManager { @@ -55,8 +55,9 @@ public abstract class DistanceManager {
final Executor mainThreadExecutor; final Executor mainThreadExecutor;
private long ticketTickCounter; private long ticketTickCounter;
public int simulationDistance = 10; public int simulationDistance = 10;
@ -6664,7 +6655,7 @@ index 2a805b9e67b7a05dda5f9caa4b63b28c940828d0..76005b3c48bfa323a77781c20c63708e
Objects.requireNonNull(mainThreadExecutor); Objects.requireNonNull(mainThreadExecutor);
ProcessorHandle<Runnable> mailbox = ProcessorHandle.of("player ticket throttler", mainThreadExecutor::execute); ProcessorHandle<Runnable> mailbox = ProcessorHandle.of("player ticket throttler", mainThreadExecutor::execute);
ChunkTaskPriorityQueueSorter chunktaskqueuesorter = new ChunkTaskPriorityQueueSorter(ImmutableList.of(mailbox), workerExecutor, 4); ChunkTaskPriorityQueueSorter chunktaskqueuesorter = new ChunkTaskPriorityQueueSorter(ImmutableList.of(mailbox), workerExecutor, 4);
@@ -66,6 +67,7 @@ public abstract class DistanceManager { @@ -65,6 +66,7 @@ public abstract class DistanceManager {
this.ticketThrottlerInput = chunktaskqueuesorter.getProcessor(mailbox, true); this.ticketThrottlerInput = chunktaskqueuesorter.getProcessor(mailbox, true);
this.ticketThrottlerReleaser = chunktaskqueuesorter.getReleaseProcessor(mailbox); this.ticketThrottlerReleaser = chunktaskqueuesorter.getReleaseProcessor(mailbox);
this.mainThreadExecutor = mainThreadExecutor; this.mainThreadExecutor = mainThreadExecutor;
@ -6672,20 +6663,20 @@ index 2a805b9e67b7a05dda5f9caa4b63b28c940828d0..76005b3c48bfa323a77781c20c63708e
} }
protected void purgeStaleTickets() { protected void purgeStaleTickets() {
@@ -378,7 +380,7 @@ public abstract class DistanceManager { @@ -377,7 +379,7 @@ public abstract class DistanceManager {
} }
public void removeTicketsOnClosing() { public void removeTicketsOnClosing() {
- ImmutableSet<TicketType<?>> immutableset = ImmutableSet.of(TicketType.UNKNOWN, TicketType.POST_TELEPORT, TicketType.LIGHT); - ImmutableSet<TicketType<?>> immutableset = ImmutableSet.of(TicketType.UNKNOWN, TicketType.POST_TELEPORT, TicketType.LIGHT);
+ ImmutableSet<TicketType<?>> immutableset = ImmutableSet.of(TicketType.UNKNOWN, TicketType.POST_TELEPORT, TicketType.LIGHT, TicketType.FUTURE_AWAIT); // Paper - add additional tickets to preserve + ImmutableSet<TicketType<?>> immutableset = ImmutableSet.of(TicketType.UNKNOWN, TicketType.POST_TELEPORT, TicketType.LIGHT, TicketType.FUTURE_AWAIT); // Paper - add additional tickets to preserve
ObjectIterator objectiterator = this.tickets.long2ObjectEntrySet().fastIterator(); ObjectIterator<Entry<SortedArraySet<Ticket<?>>>> objectiterator = this.tickets.long2ObjectEntrySet().fastIterator();
while (objectiterator.hasNext()) { while (objectiterator.hasNext()) {
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 1d12a7934308aa48d7ea7fa10c7b6b5ccb27e707..2c4727bf4571e1596bb0696b25104155f6302065 100644 index 8661ed9962d07fb40390faf7f186b9cd8ce6bc62..23c39b78486b018e222af489c8edbf4e749abff6 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -49,6 +49,7 @@ import net.minecraft.world.level.storage.LevelStorageSource; @@ -47,6 +47,7 @@ import net.minecraft.world.level.storage.LevelStorageSource;
public class ServerChunkCache extends ChunkSource { public class ServerChunkCache extends ChunkSource {
@ -6693,7 +6684,7 @@ index 1d12a7934308aa48d7ea7fa10c7b6b5ccb27e707..2c4727bf4571e1596bb0696b25104155
private static final List<ChunkStatus> CHUNK_STATUSES = ChunkStatus.getStatusList(); private static final List<ChunkStatus> CHUNK_STATUSES = ChunkStatus.getStatusList();
private final DistanceManager distanceManager; private final DistanceManager distanceManager;
final ServerLevel level; final ServerLevel level;
@@ -67,6 +68,14 @@ public class ServerChunkCache extends ChunkSource { @@ -65,6 +66,14 @@ public class ServerChunkCache extends ChunkSource {
@Nullable @Nullable
@VisibleForDebug @VisibleForDebug
private NaturalSpawner.SpawnState lastSpawnState; private NaturalSpawner.SpawnState lastSpawnState;
@ -6708,7 +6699,7 @@ index 1d12a7934308aa48d7ea7fa10c7b6b5ccb27e707..2c4727bf4571e1596bb0696b25104155
public ServerChunkCache(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureTemplateManager structureTemplateManager, Executor workerExecutor, ChunkGenerator chunkGenerator, int viewDistance, int simulationDistance, boolean dsync, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory) { public ServerChunkCache(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureTemplateManager structureTemplateManager, Executor workerExecutor, ChunkGenerator chunkGenerator, int viewDistance, int simulationDistance, boolean dsync, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory) {
this.level = world; this.level = world;
@@ -92,6 +101,124 @@ public class ServerChunkCache extends ChunkSource { @@ -90,6 +99,124 @@ public class ServerChunkCache extends ChunkSource {
return chunk.getFullChunkNow() != null; return chunk.getFullChunkNow() != null;
} }
// CraftBukkit end // CraftBukkit end
@ -6833,7 +6824,7 @@ index 1d12a7934308aa48d7ea7fa10c7b6b5ccb27e707..2c4727bf4571e1596bb0696b25104155
@Override @Override
public ThreadedLevelLightEngine getLightEngine() { public ThreadedLevelLightEngine getLightEngine() {
@@ -315,7 +442,7 @@ public class ServerChunkCache extends ChunkSource { @@ -310,7 +437,7 @@ public class ServerChunkCache extends ChunkSource {
return this.mainThreadProcessor.pollTask(); return this.mainThreadProcessor.pollTask();
} }
@ -6842,7 +6833,7 @@ index 1d12a7934308aa48d7ea7fa10c7b6b5ccb27e707..2c4727bf4571e1596bb0696b25104155
boolean flag = this.distanceManager.runAllUpdates(this.chunkMap); boolean flag = this.distanceManager.runAllUpdates(this.chunkMap);
boolean flag1 = this.chunkMap.promoteChunkMap(); boolean flag1 = this.chunkMap.promoteChunkMap();
@@ -327,6 +454,12 @@ public class ServerChunkCache extends ChunkSource { @@ -322,6 +449,12 @@ public class ServerChunkCache extends ChunkSource {
} }
} }
@ -6856,10 +6847,10 @@ index 1d12a7934308aa48d7ea7fa10c7b6b5ccb27e707..2c4727bf4571e1596bb0696b25104155
ChunkHolder playerchunk = this.getVisibleChunkIfPresent(pos); ChunkHolder playerchunk = this.getVisibleChunkIfPresent(pos);
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 30fc222c384938fb4fdd4c6715295aeea57094bc..9ea829aafa7a874a784d02da889576c80de17d0c 100644 index b3caf69f9627ba2114dc9d06551ccf182debfb04..2567f0d6060c29c75ba8d4331ec51ad0f3a51883 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -230,6 +230,98 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -235,6 +235,98 @@ public class ServerLevel extends Level implements WorldGenLevel {
return this.convertable.dimensionType; return this.convertable.dimensionType;
} }
@ -6959,10 +6950,10 @@ index 30fc222c384938fb4fdd4c6715295aeea57094bc..9ea829aafa7a874a784d02da889576c8
public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey<Level> resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List<CustomSpawner> list, boolean flag1, @Nullable RandomSequences randomsequences, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) { public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey<Level> resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List<CustomSpawner> list, boolean flag1, @Nullable RandomSequences randomsequences, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
// IRegistryCustom.Dimension iregistrycustom_dimension = minecraftserver.registryAccess(); // CraftBukkit - decompile error // IRegistryCustom.Dimension iregistrycustom_dimension = minecraftserver.registryAccess(); // CraftBukkit - decompile error
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index b758a86c3d4744674faf25a6aea53c15a62ce234..c57b91c2385d118590bc419e7e6ed586d5d87422 100644 index bc263349531d70886d5eee37a196c78dd70c9b30..5631621f16fdda723cb3e1de7d3a6646d768a863 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -259,6 +259,8 @@ public class ServerPlayer extends Player { @@ -275,6 +275,8 @@ public class ServerPlayer extends Player {
public boolean sentListPacket = false; public boolean sentListPacket = false;
public String kickLeaveMessage = null; // SPIGOT-3034: Forward leave message to PlayerQuitEvent public String kickLeaveMessage = null; // SPIGOT-3034: Forward leave message to PlayerQuitEvent
// CraftBukkit end // CraftBukkit end
@ -6971,9 +6962,9 @@ index b758a86c3d4744674faf25a6aea53c15a62ce234..c57b91c2385d118590bc419e7e6ed586
public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, ClientInformation clientOptions) { public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, ClientInformation clientOptions) {
super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile); super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile);
@@ -327,6 +329,8 @@ public class ServerPlayer extends Player { @@ -343,6 +345,8 @@ public class ServerPlayer extends Player {
this.fudgeSpawnLocation(world);
this.updateOptions(clientOptions); this.updateOptions(clientOptions);
this.object = null;
+ this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper + this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper
+ +
@ -6993,10 +6984,10 @@ index 3a4f026c73cdd22d30bdadabbcf24bef969b73e4..0d536d72ac918fbd403397ff369d1014
private final String name; private final String name;
private final Comparator<T> comparator; private final Comparator<T> comparator;
diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
index 43040b678206092bcb06acde919b75ecb78564df..d11741d2618976bdb51f75d823f260f32d5bafc9 100644 index 7cc559730325a18953d7cb75ed252aefa379c324..744efc6cdc99f653a1eb9d4f26af8a7c34627f5e 100644
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java --- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java +++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
@@ -160,6 +160,26 @@ public class WorldGenRegion implements WorldGenLevel { @@ -168,6 +168,26 @@ public class WorldGenRegion implements WorldGenLevel {
return chunkX >= this.firstPos.x && chunkX <= this.lastPos.x && chunkZ >= this.firstPos.z && chunkZ <= this.lastPos.z; return chunkX >= this.firstPos.x && chunkX <= this.lastPos.x && chunkZ >= this.firstPos.z && chunkZ <= this.lastPos.z;
} }
@ -7024,22 +7015,22 @@ index 43040b678206092bcb06acde919b75ecb78564df..d11741d2618976bdb51f75d823f260f3
public BlockState getBlockState(BlockPos pos) { public BlockState getBlockState(BlockPos pos) {
return this.getChunk(SectionPos.blockToSectionCoord(pos.getX()), SectionPos.blockToSectionCoord(pos.getZ())).getBlockState(pos); return this.getChunk(SectionPos.blockToSectionCoord(pos.getX()), SectionPos.blockToSectionCoord(pos.getZ())).getBlockState(pos);
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 93e0de052ea54cc1dee1ebc017fefb634eb42f8d..2e8e786407869b53cb4d7e4ec8f91fe0a3ad8e1a 100644 index aef7c373261bc150a19fa642bb9c5dc7ae1d7f53..54fee00a462c2f6fcc567d762b1afd24cf5c7d06 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -178,6 +178,7 @@ public abstract class PlayerList { @@ -180,6 +180,7 @@ public abstract class PlayerList {
} }
public void placeNewPlayer(Connection connection, ServerPlayer player, CommonListenerCookie clientData) { public void placeNewPlayer(Connection connection, ServerPlayer player, CommonListenerCookie clientData) {
+ player.isRealPlayer = true; // Paper + player.isRealPlayer = true; // Paper
GameProfile gameprofile = player.getGameProfile(); GameProfile gameprofile = player.getGameProfile();
GameProfileCache usercache = this.server.getProfileCache(); GameProfileCache usercache = this.server.getProfileCache();
String s; // Optional optional; // CraftBukkit - decompile error
diff --git a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java diff --git a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java
index 9eba8e87e34abb23c0a32cb7ffbaaf272616418a..03e8707258e9b73cf12a4750270ab7573bb1c812 100644 index aede9b65e799a1f123f71f9390fb05acddda676b..2510589400b3012b827efcab477c6483d9d55901 100644
--- a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java --- a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java
+++ b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java +++ b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java
@@ -77,6 +77,13 @@ public abstract class BlockableEventLoop<R extends Runnable> implements Profiler @@ -79,6 +79,13 @@ public abstract class BlockableEventLoop<R extends Runnable> implements Profiler
runnable.run(); runnable.run();
} }
} }
@ -7054,10 +7045,10 @@ index 9eba8e87e34abb23c0a32cb7ffbaaf272616418a..03e8707258e9b73cf12a4750270ab757
@Override @Override
public void tell(R runnable) { public void tell(R runnable) {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index cdefbfb7a578d5f90b24f24dbc9a0fe627b91474..17e489c4650ba421a993c863426f1a2084d44fb0 100644 index 803f8e80d616ac7f9a51e4cdd6a7a3ce690b791e..9c54bc3897d1fa3c88a5a7d55224eb4cc97f4e79 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -331,6 +331,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -333,6 +333,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return this.level.hasChunk((int) Math.floor(this.getX()) >> 4, (int) Math.floor(this.getZ()) >> 4); return this.level.hasChunk((int) Math.floor(this.getX()) >> 4, (int) Math.floor(this.getZ()) >> 4);
} }
// CraftBukkit end // CraftBukkit end
@ -7070,10 +7061,10 @@ index cdefbfb7a578d5f90b24f24dbc9a0fe627b91474..17e489c4650ba421a993c863426f1a20
public Entity(EntityType<?> type, Level world) { public Entity(EntityType<?> type, Level world) {
this.id = Entity.ENTITY_COUNTER.incrementAndGet(); this.id = Entity.ENTITY_COUNTER.incrementAndGet();
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 36cedbf1b17a40cf15bc7207c263173d4571b466..cdac785c54e150c0886046b8d50657c0ca958438 100644 index 09a3d06f1c613662283eb6688bf2c3eeb4778208..dcf53dbecc1873994b171cfd1eb313545d6cfdcd 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -259,6 +259,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -270,6 +270,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
public boolean collides = true; public boolean collides = true;
public Set<UUID> collidableExemptions = new HashSet<>(); public Set<UUID> collidableExemptions = new HashSet<>();
public boolean bukkitPickUpLoot; public boolean bukkitPickUpLoot;
@ -7082,22 +7073,23 @@ index 36cedbf1b17a40cf15bc7207c263173d4571b466..cdac785c54e150c0886046b8d50657c0
@Override @Override
public float getBukkitYaw() { public float getBukkitYaw() {
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 13adb7f79073ff4b01906df61098c5436eb613e3..8892a6344b3a96a3d412528b80ce7bcf1ab30003 100644 index ed88e2bbc848b003e2143cd4a372c58c890cfe5c..7d04a18f62411f00dc7be59564ac6c292834c08a 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java --- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -278,6 +278,7 @@ public abstract class Mob extends LivingEntity implements Targeting { @@ -287,6 +287,8 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
return this.target; return this.target;
} }
+ public org.bukkit.craftbukkit.entity.CraftMob getBukkitMob() { return (org.bukkit.craftbukkit.entity.CraftMob) super.getBukkitEntity(); } // Paper + public org.bukkit.craftbukkit.entity.CraftMob getBukkitMob() { return (org.bukkit.craftbukkit.entity.CraftMob) super.getBukkitEntity(); } // Paper
public void setTarget(@Nullable LivingEntity target) { +
// CraftBukkit start - fire event @Nullable
this.setTarget(target, EntityTargetEvent.TargetReason.UNKNOWN, true); protected final LivingEntity getTargetFromBrain() {
return (LivingEntity) this.getBrain().getMemory(MemoryModuleType.ATTACK_TARGET).orElse(null); // CraftBukkit - decompile error
diff --git a/src/main/java/net/minecraft/world/entity/PathfinderMob.java b/src/main/java/net/minecraft/world/entity/PathfinderMob.java diff --git a/src/main/java/net/minecraft/world/entity/PathfinderMob.java b/src/main/java/net/minecraft/world/entity/PathfinderMob.java
index 21fa43e0c3fabf74919f7e41d074ab1f7c061967..5e9cf929674888b3a143a0691dc6936b304467f1 100644 index 566c28169c68a9699ddba3fdd37edfd1bae64fe4..5e2f10f5fd7219ebaefb1c5b5ac9bc7c71fae179 100644
--- a/src/main/java/net/minecraft/world/entity/PathfinderMob.java --- a/src/main/java/net/minecraft/world/entity/PathfinderMob.java
+++ b/src/main/java/net/minecraft/world/entity/PathfinderMob.java +++ b/src/main/java/net/minecraft/world/entity/PathfinderMob.java
@@ -20,6 +20,8 @@ public abstract class PathfinderMob extends Mob { @@ -22,6 +22,8 @@ public abstract class PathfinderMob extends Mob {
super(type, world); super(type, world);
} }
@ -7119,11 +7111,11 @@ index f73604d762efbac400d40f536ec1782fca584efa..4701bf9ee203f2f15b0b68e84bbfa2c4
super(type, world); super(type, world);
this.xpReward = 5; this.xpReward = 5;
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index a7cbd0b9e37717215c03809e025f877e9c0a40b8..6291265ae4691bf7dffe196d20571c1c30e8d906 100644 index 74486f93527536d128e09ce03a99bdec4d99f2d9..2535cbf50087a4631c4d1027a61b173121d729bc 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java --- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -825,6 +825,25 @@ public final class ItemStack { @@ -957,6 +957,25 @@ public final class ItemStack implements DataComponentHolder {
return this.tag != null ? this.tag.getList("Enchantments", 10) : new ListTag(); }
} }
+ // Paper start - (this is just a good no conflict location) + // Paper start - (this is just a good no conflict location)
@ -7145,10 +7137,10 @@ index a7cbd0b9e37717215c03809e025f877e9c0a40b8..6291265ae4691bf7dffe196d20571c1c
+ } + }
+ // Paper end + // Paper end
+ +
public void setTag(@Nullable CompoundTag nbt) { public void applyComponents(DataComponentPatch changes) {
this.tag = nbt; this.components.applyPatch(changes);
if (this.getItem().canBeDepleted()) { this.getItem().verifyComponentsAfterLoad(this);
@@ -1214,6 +1233,7 @@ public final class ItemStack { @@ -1210,6 +1229,7 @@ public final class ItemStack implements DataComponentHolder {
// CraftBukkit start // CraftBukkit start
@Deprecated @Deprecated
public void setItem(Item item) { public void setItem(Item item) {
@ -7249,18 +7241,18 @@ index 3c707d6674b2594b09503b959a31c1f4ad3981e6..db61b6b0158a9bcc0e1d735e34fe3671
public BlockState getBlockState(BlockPos pos) { public BlockState getBlockState(BlockPos pos) {
return Blocks.AIR.defaultBlockState(); return Blocks.AIR.defaultBlockState();
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index bd9ea2bd012cdcf07ac322b3e0360c6c336ab1f9..bede1a64e4f04aa8e87ddb44f2cc4a1ab46a3b81 100644 index b06ffa8d5953c8f0a47daf056495cd424d9ac843..68715d9fd69addad07384efa10eeb09bc78c1e28 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -93,6 +93,7 @@ import org.bukkit.craftbukkit.CraftServer; @@ -94,6 +94,7 @@ import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.craftbukkit.SpigotTimings; // Spigot import org.bukkit.craftbukkit.SpigotTimings; // Spigot
import org.bukkit.craftbukkit.block.CapturedBlockState; import org.bukkit.craftbukkit.block.CapturedBlockState;
+import org.bukkit.craftbukkit.block.CraftBlockState; +import org.bukkit.craftbukkit.block.CraftBlockState;
import org.bukkit.craftbukkit.block.data.CraftBlockData; import org.bukkit.craftbukkit.block.data.CraftBlockData;
import org.bukkit.craftbukkit.util.CraftSpawnCategory; import org.bukkit.craftbukkit.util.CraftSpawnCategory;
import org.bukkit.craftbukkit.util.CraftNamespacedKey; import org.bukkit.entity.SpawnCategory;
@@ -279,6 +280,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -273,6 +274,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return null; return null;
} }
@ -7274,7 +7266,7 @@ index bd9ea2bd012cdcf07ac322b3e0360c6c336ab1f9..bede1a64e4f04aa8e87ddb44f2cc4a1a
public boolean isInWorldBounds(BlockPos pos) { public boolean isInWorldBounds(BlockPos pos) {
return !this.isOutsideBuildHeight(pos) && Level.isInWorldBoundsHorizontal(pos); return !this.isOutsideBuildHeight(pos) && Level.isInWorldBoundsHorizontal(pos);
} }
@@ -295,18 +303,52 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -289,18 +297,52 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return y < -20000000 || y >= 20000000; return y < -20000000 || y >= 20000000;
} }
@ -7331,7 +7323,7 @@ index bd9ea2bd012cdcf07ac322b3e0360c6c336ab1f9..bede1a64e4f04aa8e87ddb44f2cc4a1a
ChunkAccess ichunkaccess = this.getChunkSource().getChunk(chunkX, chunkZ, leastStatus, create); ChunkAccess ichunkaccess = this.getChunkSource().getChunk(chunkX, chunkZ, leastStatus, create);
if (ichunkaccess == null && create) { if (ichunkaccess == null && create) {
@@ -317,7 +359,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -311,7 +353,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
} }
@Override @Override
@ -7340,7 +7332,7 @@ index bd9ea2bd012cdcf07ac322b3e0360c6c336ab1f9..bede1a64e4f04aa8e87ddb44f2cc4a1a
return this.setBlock(pos, state, flags, 512); return this.setBlock(pos, state, flags, 512);
} }
@@ -556,7 +598,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -550,7 +592,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
if (this.isOutsideBuildHeight(pos)) { if (this.isOutsideBuildHeight(pos)) {
return Blocks.VOID_AIR.defaultBlockState(); return Blocks.VOID_AIR.defaultBlockState();
} else { } else {
@ -7350,7 +7342,7 @@ index bd9ea2bd012cdcf07ac322b3e0360c6c336ab1f9..bede1a64e4f04aa8e87ddb44f2cc4a1a
return chunk.getBlockState(pos); return chunk.getBlockState(pos);
} }
diff --git a/src/main/java/net/minecraft/world/level/LevelReader.java b/src/main/java/net/minecraft/world/level/LevelReader.java diff --git a/src/main/java/net/minecraft/world/level/LevelReader.java b/src/main/java/net/minecraft/world/level/LevelReader.java
index daa1e9bf39666233dd80eeee0ffd76e168376889..ced67cf88c91c5270a0060a7307f36739237cbb2 100644 index 749e4ea1be56b393877b5fdd72dc3669dbf5a3dd..a0ae26d6197e1069ca09982b4f8b706c55ae8491 100644
--- a/src/main/java/net/minecraft/world/level/LevelReader.java --- a/src/main/java/net/minecraft/world/level/LevelReader.java
+++ b/src/main/java/net/minecraft/world/level/LevelReader.java +++ b/src/main/java/net/minecraft/world/level/LevelReader.java
@@ -26,6 +26,9 @@ public interface LevelReader extends BlockAndTintGetter, CollisionGetter, Signal @@ -26,6 +26,9 @@ public interface LevelReader extends BlockAndTintGetter, CollisionGetter, Signal
@ -7416,10 +7408,10 @@ index 497792978bdf0e6a53d772304770e8df3e7416ea..c5454b92ca2565461c799d7340160f9f
public WorldBorder getWorldBorder() { public WorldBorder getWorldBorder() {
return this.level.getWorldBorder(); return this.level.getWorldBorder();
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
index 171956fbe47032cfac8811ab7fbe94415560304b..b6d3f9f9520e410526cfeabcdeb9720dbe30e4bf 100644 index 054921c9a58adf90e81448274972d43aaf5175bf..08eb369f8cb4c35be17cef816a0d33295a1ae3e0 100644
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java --- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
@@ -896,12 +896,20 @@ public abstract class BlockBehaviour implements FeatureElement { @@ -828,12 +828,20 @@ public abstract class BlockBehaviour implements FeatureElement {
} }
} }
@ -7440,7 +7432,7 @@ index 171956fbe47032cfac8811ab7fbe94415560304b..b6d3f9f9520e410526cfeabcdeb9720d
this.legacySolid = this.calculateSolid(); this.legacySolid = this.calculateSolid();
} }
@@ -948,8 +956,8 @@ public abstract class BlockBehaviour implements FeatureElement { @@ -880,8 +888,8 @@ public abstract class BlockBehaviour implements FeatureElement {
return this.getBlock().getOcclusionShape(this.asState(), world, pos); return this.getBlock().getOcclusionShape(this.asState(), world, pos);
} }
@ -7452,10 +7444,10 @@ index 171956fbe47032cfac8811ab7fbe94415560304b..b6d3f9f9520e410526cfeabcdeb9720d
public boolean useShapeForLightOcclusion() { public boolean useShapeForLightOcclusion() {
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
index 532a0cae6db0d830e720a72e9021aa7a8ed0f106..e5e562f75e7d4b6a750f192842940c5e3af81e7d 100644 index 75cfa73a6a32d9e1f5c07af4af6e16e66c993968..f4e3bd2ae4f63e6d3d25463a3635b8f89fecc068 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java --- a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
@@ -62,7 +62,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom @@ -65,7 +65,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
protected final ShortList[] postProcessing; protected final ShortList[] postProcessing;
protected volatile boolean unsaved; protected volatile boolean unsaved;
private volatile boolean isLightCorrect; private volatile boolean isLightCorrect;
@ -7464,7 +7456,7 @@ index 532a0cae6db0d830e720a72e9021aa7a8ed0f106..e5e562f75e7d4b6a750f192842940c5e
private long inhabitedTime; private long inhabitedTime;
/** @deprecated */ /** @deprecated */
@Nullable @Nullable
@@ -88,7 +88,8 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom @@ -91,7 +91,8 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
// CraftBukkit end // CraftBukkit end
public ChunkAccess(ChunkPos pos, UpgradeData upgradeData, LevelHeightAccessor heightLimitView, Registry<Biome> biomeRegistry, long inhabitedTime, @Nullable LevelChunkSection[] sectionArray, @Nullable BlendingData blendingData) { public ChunkAccess(ChunkPos pos, UpgradeData upgradeData, LevelHeightAccessor heightLimitView, Registry<Biome> biomeRegistry, long inhabitedTime, @Nullable LevelChunkSection[] sectionArray, @Nullable BlendingData blendingData) {
@ -7492,10 +7484,10 @@ index ca0991b07def35b4697ba6d5569bf9a080e48a1c..2ee1658532cb00d7bcd1d11e03f19d21
@Nullable @Nullable
@Override @Override
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index 57805b84054e44a3d7c95cf269316a42205bb99c..409007f6e6940e5ea92e3cbaa74e55cdee50325b 100644 index 3978407cf96c0eb527c16f161af570a2bf030631..bb0f16aef406bdc627e1263859dd4637bec90c63 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -114,6 +114,109 @@ public class LevelChunk extends ChunkAccess { @@ -116,6 +116,109 @@ public class LevelChunk extends ChunkAccess {
public boolean needsDecoration; public boolean needsDecoration;
// CraftBukkit end // CraftBukkit end
@ -7700,7 +7692,7 @@ index 57805b84054e44a3d7c95cf269316a42205bb99c..409007f6e6940e5ea92e3cbaa74e55cd
@Override @Override
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
index d59392c322936ce89b759ac9787c8f4f0b228af6..2d6daf76a56574c9727b404feb4f86347f04cbae 100644 index ca4c8f74a1ab2a8b36e193a2c40c3bd76565d258..2c153af611399e884752f8256bee4fe32de5c572 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
@@ -19,7 +19,7 @@ public class LevelChunkSection { @@ -19,7 +19,7 @@ public class LevelChunkSection {
@ -7713,10 +7705,10 @@ index d59392c322936ce89b759ac9787c8f4f0b228af6..2d6daf76a56574c9727b404feb4f8634
private short tickingFluidCount; private short tickingFluidCount;
public final PalettedContainer<BlockState> states; public final PalettedContainer<BlockState> states;
diff --git a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java diff --git a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
index 47d1a5142bdddfa89b1d84002784c1328d8ac3b4..03e5e5c5ea003ba52b9f3ee405cd77e22ea387c8 100644 index 0f2b1dcf536f6d5f2d65e0060418511944ff6ab8..bcc70883d23d38c408130ffe778205e371ff4e8a 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java --- a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
@@ -81,6 +81,18 @@ public class ProtoChunk extends ChunkAccess { @@ -83,6 +83,18 @@ public class ProtoChunk extends ChunkAccess {
return new ChunkAccess.TicksToSave(this.blockTicks, this.fluidTicks); return new ChunkAccess.TicksToSave(this.blockTicks, this.fluidTicks);
} }
@ -7736,7 +7728,7 @@ index 47d1a5142bdddfa89b1d84002784c1328d8ac3b4..03e5e5c5ea003ba52b9f3ee405cd77e2
public BlockState getBlockState(BlockPos pos) { public BlockState getBlockState(BlockPos pos) {
int i = pos.getY(); int i = pos.getY();
diff --git a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java diff --git a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
index e3709b2b40beb8f95e5b9bb7d20141e16b3192e3..8f23b45dce35617bb56b21fb4f7a09baf36d40c5 100644 index 34933c5324126f9afdc5cba9dea997ace8f01806..219062cff8a05c765b092f1525043d9d9a1153ae 100644
--- a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java --- a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
+++ b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java +++ b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
@@ -91,6 +91,18 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A @@ -91,6 +91,18 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
@ -7759,10 +7751,10 @@ index e3709b2b40beb8f95e5b9bb7d20141e16b3192e3..8f23b45dce35617bb56b21fb4f7a09ba
return false; return false;
} else { } else {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 2cc1871c81056acd0582184bb684e672d14d3b6f..5cf26c39b00ea1f7b1c5719f434af79fb20c6c60 100644 index 080c0cf84d959e1acdde088f367bd005ea9c3bbd..9b299f74336ad0efecd05a4b771ac58549d5fb6a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2543,4 +2543,9 @@ public final class CraftServer implements Server { @@ -2561,4 +2561,9 @@ public final class CraftServer implements Server {
return this.spigot; return this.spigot;
} }
// Spigot end // Spigot end
@ -7773,7 +7765,7 @@ index 2cc1871c81056acd0582184bb684e672d14d3b6f..5cf26c39b00ea1f7b1c5719f434af79f
+ } + }
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 0630680d1ff7ffd2e9c323a800213b1137817642..f012ba9c55241afb159136e8b55e774047efa2c8 100644 index 62ad3102e20415185b7dfa9effc305a5465252cc..a1b34778332472c09f3191bc72f9eb3df5e54ba4 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -252,8 +252,8 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -252,8 +252,8 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@ -7796,7 +7788,7 @@ index 0630680d1ff7ffd2e9c323a800213b1137817642..f012ba9c55241afb159136e8b55e7740
if (playerChunk == null) return false; if (playerChunk == null) return false;
playerChunk.getTickingChunkFuture().thenAccept(either -> { playerChunk.getTickingChunkFuture().thenAccept(either -> {
@@ -2075,4 +2075,55 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -2079,4 +2079,55 @@ public class CraftWorld extends CraftRegionAccessor implements World {
return this.spigot; return this.spigot;
} }
// Spigot end // Spigot end
@ -7853,10 +7845,10 @@ index 0630680d1ff7ffd2e9c323a800213b1137817642..f012ba9c55241afb159136e8b55e7740
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index ed501b794c222278dca98f8ece6096db1d8108a5..be3a8e54d64b3cc145ab09b0bc7abb3f4ee153c3 100644 index 13d3a8fa36455c99b99599eac93bc2462e82fd7a..a7a82910e42d7040901b38e3a9409bef1ca7b2a9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2335,4 +2335,34 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2403,4 +2403,34 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this.spigot; return this.spigot;
} }
// Spigot end // Spigot end
@ -7892,10 +7884,10 @@ index ed501b794c222278dca98f8ece6096db1d8108a5..be3a8e54d64b3cc145ab09b0bc7abb3f
+ } + }
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index bf46aa3bd46ffabe92d58aa45ea0dfe6c98d94aa..0bb01e53f1c15071c8cd818cce79af8196fe790f 100644 index 29286c0fdd9720e0842f945d03010ec61f1daa64..1f99a9b9a0510ab19a5913588d6d677d6cada5e5 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -23,6 +23,20 @@ import org.bukkit.material.MaterialData; @@ -22,6 +22,20 @@ import org.bukkit.material.MaterialData;
@DelegateDeserialization(ItemStack.class) @DelegateDeserialization(ItemStack.class)
public final class CraftItemStack extends ItemStack { public final class CraftItemStack extends ItemStack {
@ -8139,10 +8131,10 @@ index 0000000000000000000000000000000000000000..909b2c98e7a9117d2f737245e4661792
+ } + }
+} +}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 09b3bfa3ad0cf060b126cffd1de1032bc329cb44..30f0c671464e2d4557845f150d8d18bfcd645e14 100644 index 2ee0f83f18477fe2c759dc1ccc5ee18dbe791527..38d72d95b1f3ab23710f3335177c59ea6a25270e 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -107,8 +107,17 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -105,8 +105,17 @@ public final class CraftMagicNumbers implements UnsafeValues {
private static final Map<Item, Material> ITEM_MATERIAL = new HashMap<>(); private static final Map<Item, Material> ITEM_MATERIAL = new HashMap<>();
private static final Map<Material, Item> MATERIAL_ITEM = new HashMap<>(); private static final Map<Material, Item> MATERIAL_ITEM = new HashMap<>();
private static final Map<Material, Block> MATERIAL_BLOCK = new HashMap<>(); private static final Map<Material, Block> MATERIAL_BLOCK = new HashMap<>();
@ -8160,7 +8152,7 @@ index 09b3bfa3ad0cf060b126cffd1de1032bc329cb44..30f0c671464e2d4557845f150d8d18bf
for (Block block : BuiltInRegistries.BLOCK) { for (Block block : BuiltInRegistries.BLOCK) {
BLOCK_MATERIAL.put(block, Material.getMaterial(BuiltInRegistries.BLOCK.getKey(block).getPath().toUpperCase(Locale.ROOT))); BLOCK_MATERIAL.put(block, Material.getMaterial(BuiltInRegistries.BLOCK.getKey(block).getPath().toUpperCase(Locale.ROOT)));
} }
@@ -159,6 +168,14 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -157,6 +166,14 @@ public final class CraftMagicNumbers implements UnsafeValues {
public static ResourceLocation key(Material mat) { public static ResourceLocation key(Material mat) {
return CraftNamespacedKey.toMinecraft(mat.getKey()); return CraftNamespacedKey.toMinecraft(mat.getKey());
} }
@ -8176,18 +8168,18 @@ index 09b3bfa3ad0cf060b126cffd1de1032bc329cb44..30f0c671464e2d4557845f150d8d18bf
public static byte toLegacyData(BlockState data) { public static byte toLegacyData(BlockState data) {
diff --git a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java diff --git a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
index 1cce46ecfeb93b17b81f206054a6a2a67d2aefcb..e37c2d82ed606cbfe00c152b08c3ab99ac751f69 100644 index 5fd6eb754c4edebed6798c65b06507a4e89ca48f..0794d92c42b0db6b367505ae28f09f1fd39fa312 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java --- a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java +++ b/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
@@ -59,6 +59,7 @@ import net.minecraft.world.ticks.LevelTickAccess; @@ -58,6 +58,7 @@ import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.ticks.ScheduledTick; import net.minecraft.world.ticks.LevelTickAccess;
import net.minecraft.world.ticks.TickPriority; import net.minecraft.world.ticks.TickPriority;
import org.bukkit.event.entity.CreatureSpawnEvent; import org.bukkit.event.entity.CreatureSpawnEvent;
+import org.jetbrains.annotations.Nullable; +import org.jetbrains.annotations.Nullable;
public abstract class DelegatedGeneratorAccess implements WorldGenLevel { public abstract class DelegatedGeneratorAccess implements WorldGenLevel {
@@ -818,4 +819,24 @@ public abstract class DelegatedGeneratorAccess implements WorldGenLevel { @@ -807,4 +808,24 @@ public abstract class DelegatedGeneratorAccess implements WorldGenLevel {
public int getMoonPhase() { public int getMoonPhase() {
return this.handle.getMoonPhase(); return this.handle.getMoonPhase();
} }
@ -8213,7 +8205,7 @@ index 1cce46ecfeb93b17b81f206054a6a2a67d2aefcb..e37c2d82ed606cbfe00c152b08c3ab99
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java diff --git a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
index fe3d8ad5de53387236d48ed3a6f2b677ed895bc3..440660dfa70d57e94ae4eef1dce783aee5034f7e 100644 index e837d76e833d73d888bc1dad3515c2b82bc0e437..4705aed1dd98378c146bf9e346df1a17f719ad36 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java --- a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java +++ b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
@@ -212,7 +212,23 @@ public class DummyGeneratorAccess implements WorldGenLevel { @@ -212,7 +212,23 @@ public class DummyGeneratorAccess implements WorldGenLevel {
@ -8292,7 +8284,7 @@ index 0c7c97f27853843ec714e47f5b570f9d09bbba14..ff422d4d4f2b764370f0ee2af1303485
ANIMAL, ANIMAL,
RAIDER, RAIDER,
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
index df29015e3d5ca49297fe87090fd6446962e59adb..e6e070db9a6ee78e65dbff6f18cb5c8784202b9f 100644 index 38219af7d0ba2d871711102b6a29139a49678f6b..60e354fe1d32cd315ed42cea4484c83c4b5e7e25 100644
--- a/src/main/java/org/spigotmc/SpigotConfig.java --- a/src/main/java/org/spigotmc/SpigotConfig.java
+++ b/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java
@@ -118,7 +118,11 @@ public class SpigotConfig @@ -118,7 +118,11 @@ public class SpigotConfig