mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-22 06:25:15 +01:00
First server patches
This commit is contained in:
parent
028e2d9f00
commit
a9c507310b
10 changed files with 622 additions and 590 deletions
|
@ -9,3 +9,4 @@
|
|||
# minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter
|
||||
# minecraft net/minecraft/world/level/entity/LevelEntityGetter.java
|
||||
|
||||
minecraft net.minecraft.network.protocol.game.ClientboundPlayerChatPacket
|
||||
|
|
|
@ -28,7 +28,7 @@ index 67fb370cad6924895a6b27052dbd5c1767e3f0c9..bb338269c9e3bef4c274157c490d8b8f
|
|||
+/.factorypath
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..3451ca066dc093879d540b6c297f8814f40c15f2
|
||||
index 0000000000000000000000000000000000000000..25104e978c36adc91a65d81c5c8effc064c93091
|
||||
--- /dev/null
|
||||
+++ b/build.gradle.kts
|
||||
@@ -0,0 +1,138 @@
|
||||
|
@ -59,7 +59,7 @@ index 0000000000000000000000000000000000000000..3451ca066dc093879d540b6c297f8814
|
|||
+ testImplementation("org.hamcrest:hamcrest-library:1.3")
|
||||
+}
|
||||
+
|
||||
+val craftbukkitPackageVersion = "1_18_R2" // Paper
|
||||
+val craftbukkitPackageVersion = "1_19_R1" // Paper
|
||||
+tasks.jar {
|
||||
+ archiveClassifier.set("dev")
|
||||
+
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Remap fixes
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java
|
||||
index cdd5d95326c663c1c493c45a28918a12ac6b449f..5311c40d9bf22b423a69bc722a6125493e616eac 100644
|
||||
index 700fd7f0ef6ba5798389b41a52f887e76917893d..eabf34265470e68b56c0d8787a7acffcf9b49e83 100644
|
||||
--- a/src/main/java/net/minecraft/core/BlockPos.java
|
||||
+++ b/src/main/java/net/minecraft/core/BlockPos.java
|
||||
@@ -270,9 +270,11 @@ public class BlockPos extends Vec3i {
|
||||
|
@ -42,7 +42,7 @@ index cdd5d95326c663c1c493c45a28918a12ac6b449f..5311c40d9bf22b423a69bc722a612549
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/commands/SummonCommand.java b/src/main/java/net/minecraft/server/commands/SummonCommand.java
|
||||
index bb57dacc71711abfd9fb22a395ff798920564e5a..f6aed91482d9c7bf8b56fb7c53f938a4f37b9605 100644
|
||||
index da83a40a74b291879d236ffccf36ee7a626a811e..556c4fe8d0d044c2995533f4f20cbde7283a2711 100644
|
||||
--- a/src/main/java/net/minecraft/server/commands/SummonCommand.java
|
||||
+++ b/src/main/java/net/minecraft/server/commands/SummonCommand.java
|
||||
@@ -53,9 +53,9 @@ public class SummonCommand {
|
||||
|
@ -59,10 +59,10 @@ index bb57dacc71711abfd9fb22a395ff798920564e5a..f6aed91482d9c7bf8b56fb7c53f938a4
|
|||
|
||||
if (entity1 == null) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java
|
||||
index 88258cc1971c0764912d2f3cbfcd426d8f26cd62..e51a78e52969ec687956d16566494fc524e50cb8 100644
|
||||
index b2e9418aaf2b2c87f396304287595e519e72e3ad..098253e92bd95159de93fbbdf95daee341fc5752 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java
|
||||
@@ -172,11 +172,11 @@ public class BehaviorUtils {
|
||||
@@ -174,11 +174,11 @@ public class BehaviorUtils {
|
||||
|
||||
return optional.map((uuid) -> {
|
||||
return ((ServerLevel) entity.level).getEntity(uuid);
|
||||
|
@ -78,10 +78,10 @@ index 88258cc1971c0764912d2f3cbfcd426d8f26cd62..e51a78e52969ec687956d16566494fc5
|
|||
entityliving1 = entityliving2;
|
||||
} else {
|
||||
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 babb59497fcd9b5e20d8b3b13ceb9a7856edbb63..92650d816113a0f1c2b589691895ebba3424d661 100644
|
||||
index 228e402a4efb6289fba58df3c0eac4cc608d4596..17c72a767e7b749ed78a9b54af19bae5381b296c 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
||||
@@ -174,7 +174,7 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
|
||||
@@ -192,7 +192,7 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
|
||||
Builder<ResourceLocation, Recipe<?>> builder = ImmutableMap.builder();
|
||||
|
||||
recipes.forEach((irecipe) -> {
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Build system changes
|
|||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 3167619a2466fe1d3678828437b7eb17bb78ecce..9af9165b900d18baffb736b7105409210717ccef 100644
|
||||
index 3451ca066dc093879d540b6c297f8814f40c15f2..3f43a130ee7e7bd5c5178a108f3e7f23337cc83f 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -9,10 +9,9 @@ plugins {
|
||||
|
@ -16,12 +16,12 @@ index 3167619a2466fe1d3678828437b7eb17bb78ecce..9af9165b900d18baffb736b710540921
|
|||
- exclude(group = "org.apache.logging.log4j", module = "log4j-api")
|
||||
- }
|
||||
+ implementation("org.apache.logging.log4j:log4j-iostreams:2.17.1") // Paper
|
||||
implementation("org.ow2.asm:asm:9.2")
|
||||
+ implementation("org.ow2.asm:asm-commons:9.2") // Paper - ASM event executor generation
|
||||
implementation("org.ow2.asm:asm:9.3")
|
||||
+ implementation("org.ow2.asm:asm-commons:9.3") // Paper - ASM event executor generation
|
||||
implementation("commons-lang:commons-lang:2.6")
|
||||
runtimeOnly("org.xerial:sqlite-jdbc:3.36.0.3")
|
||||
runtimeOnly("mysql:mysql-connector-java:8.0.27")
|
||||
|
||||
@@ -33,6 +32,7 @@ tasks.jar {
|
||||
runtimeOnly("mysql:mysql-connector-java:8.0.29")
|
||||
@@ -34,6 +33,7 @@ tasks.jar {
|
||||
val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim()
|
||||
val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\""
|
||||
val date = git("show", "-s", "--format=%ci", gitHash).getText().trim() // Paper
|
||||
|
@ -29,7 +29,7 @@ index 3167619a2466fe1d3678828437b7eb17bb78ecce..9af9165b900d18baffb736b710540921
|
|||
attributes(
|
||||
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||
"Implementation-Title" to "CraftBukkit",
|
||||
@@ -41,6 +41,9 @@ tasks.jar {
|
||||
@@ -42,6 +42,9 @@ tasks.jar {
|
||||
"Specification-Title" to "Bukkit",
|
||||
"Specification-Version" to project.version,
|
||||
"Specification-Vendor" to "Bukkit Team",
|
||||
|
@ -40,7 +40,7 @@ index 3167619a2466fe1d3678828437b7eb17bb78ecce..9af9165b900d18baffb736b710540921
|
|||
for (tld in setOf("net", "com", "org")) {
|
||||
attributes("$tld/bukkit", "Sealed" to true)
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index 2c90c116d87e060b6da4a8ce79f839fff80db86d..e75ff70c52b097af447b7a91ef2c20c08a904d92 100644
|
||||
index 21a2be907f67d39605210d6bee53b3442665f65f..e5008c75054df38356af193fd049110d7d56e2d4 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -190,7 +190,7 @@ public class Main {
|
||||
|
@ -51,7 +51,7 @@ index 2c90c116d87e060b6da4a8ce79f839fff80db86d..e75ff70c52b097af447b7a91ef2c20c0
|
|||
+ Date buildDate = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z").parse(Main.class.getPackage().getImplementationVendor()); // Paper
|
||||
|
||||
Calendar deadline = Calendar.getInstance();
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -21);
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -3);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
index 93046379d0cefd5d3236fc59e698809acdc18f80..774556a62eb240da42e84db4502e2ed43495be17 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
|
@ -310,10 +310,10 @@ index 0000000000000000000000000000000000000000..0853ff7641103447f458b2dc08076c27
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
||||
index 9e4cca119722c2edc478fdd1a34af4370649aa5c..b49528d8a2c577def4f74ee694ffd53b481acb32 100644
|
||||
index 853e7c2019f5147e9681e95a82eaef0825b6341e..97dc1d188a57b9f499c9cdc2ec54535af380e5cb 100644
|
||||
--- a/src/main/java/net/minecraft/server/Main.java
|
||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||
@@ -109,6 +109,12 @@ public class Main {
|
||||
@@ -110,6 +110,12 @@ public class Main {
|
||||
DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(optionset); // CraftBukkit - CLI argument support
|
||||
|
||||
dedicatedserversettings.forceSave();
|
||||
|
@ -326,7 +326,7 @@ index 9e4cca119722c2edc478fdd1a34af4370649aa5c..b49528d8a2c577def4f74ee694ffd53b
|
|||
Path path1 = Paths.get("eula.txt");
|
||||
Eula eula = new Eula(path1);
|
||||
|
||||
@@ -284,6 +290,20 @@ public class Main {
|
||||
@@ -280,6 +286,20 @@ public class Main {
|
||||
|
||||
}
|
||||
|
||||
|
@ -348,10 +348,10 @@ index 9e4cca119722c2edc478fdd1a34af4370649aa5c..b49528d8a2c577def4f74ee694ffd53b
|
|||
Main.LOGGER.info("Forcing world upgrade! {}", session.getLevelId()); // CraftBukkit
|
||||
WorldUpgrader worldupgrader = new WorldUpgrader(session, dataFixer, generatorOptions, eraseCache);
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 6016216921232bedba84acc1f6a87a3cfbb75850..ef128de5fe17231b39edb12a7014291d03cf79ec 100644
|
||||
index 6cc81495d8d09ff1fbb09f2e63a16ec4fa6138ec..e24b27eb8647a90eb83ec0f78f3bb9568161ba9b 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -601,6 +601,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -569,6 +569,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
this.forceDifficulty();
|
||||
for (ServerLevel worldserver : this.getAllLevels()) {
|
||||
|
@ -360,10 +360,10 @@ index 6016216921232bedba84acc1f6a87a3cfbb75850..ef128de5fe17231b39edb12a7014291d
|
|||
worldserver.entityManager.tick(); // SPIGOT-6526: Load pending entities so they are available to the API
|
||||
this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld()));
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 882fe0e84c0607c69ad729aa7732f41554975c82..ebd94265f56ecc946ff1834ec0d45673e010453e 100644
|
||||
index 570db14d930e15a96621d0d24ce11a27dc38494b..a8d69168fd7aefb2ef1639ab7d57e627f0a2cd68 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -195,6 +195,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -188,6 +188,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
org.spigotmc.SpigotConfig.init((java.io.File) options.valueOf("spigot-settings"));
|
||||
org.spigotmc.SpigotConfig.registerCommands();
|
||||
// Spigot end
|
||||
|
@ -380,10 +380,10 @@ index 882fe0e84c0607c69ad729aa7732f41554975c82..ebd94265f56ecc946ff1834ec0d45673
|
|||
this.setPvpAllowed(dedicatedserverproperties.pvp);
|
||||
this.setFlightAllowed(dedicatedserverproperties.allowFlight);
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
index 081c324b42cea97fce2220aa2c86d02daef7688f..7c034b62dbebbbc4c9c4ceb427b1509fe8f986e3 100644
|
||||
index ce88976db29b9e9524dbe45b16721ef90afb692b..d0b3fdec88ca7e8b1a57b742c1c9b785750123e8 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -326,6 +326,12 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -327,6 +327,12 @@ public class ServerChunkCache extends ChunkSource {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -397,10 +397,10 @@ index 081c324b42cea97fce2220aa2c86d02daef7688f..7c034b62dbebbbc4c9c4ceb427b1509f
|
|||
ChunkHolder playerchunk = this.getVisibleChunkIfPresent(pos);
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
index ec57266d48998ed0c656006834c82342236ea4c9..d790c37753f019b682fe00bea392359ba18bf204 100644
|
||||
index cdf8020194f2ec1fe7b65b22c8e1f5b1c23eaefa..d14757d30040c3c9030309a8bb4a37e0c9a4d8db 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
@@ -674,4 +674,10 @@ public class EntityType<T extends Entity> implements EntityTypeTest<Entity, T> {
|
||||
@@ -673,4 +673,10 @@ public class EntityType<T extends Entity> implements EntityTypeTest<Entity, T> {
|
||||
|
||||
T create(EntityType<T> type, Level world);
|
||||
}
|
||||
|
@ -412,10 +412,10 @@ index ec57266d48998ed0c656006834c82342236ea4c9..d790c37753f019b682fe00bea392359b
|
|||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 3dce5044332ee4a8f685ab1cde02cd4c72a85b63..6ded806628f2f3fd5b357eed41990abd7e06a372 100644
|
||||
index c1194f459414dc6ca9626ab8cec48cb48cdd926b..5576da91821926cdd9c5ef09534deb843986d202 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -144,6 +144,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -150,6 +150,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
public boolean populating;
|
||||
public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot
|
||||
|
||||
|
@ -424,19 +424,19 @@ index 3dce5044332ee4a8f685ab1cde02cd4c72a85b63..6ded806628f2f3fd5b357eed41990abd
|
|||
public final SpigotTimings.WorldTimingsHandler timings; // Spigot
|
||||
public static BlockPos lastPhysicsProblem; // Spigot
|
||||
private org.spigotmc.TickLimiter entityLimiter;
|
||||
@@ -162,6 +164,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -168,6 +170,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
|
||||
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env) {
|
||||
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env) {
|
||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
|
||||
+ this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName(), this.spigotConfig); // Paper
|
||||
this.generator = gen;
|
||||
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
|
||||
index 6657edb762d234ab388b0bf7dd52f910e0e0af8b..d29c6d0536619fab5a48fbb52115dac09e7d7ca3 100644
|
||||
index 1d94c0fbdead83155aefc8d4a16dbcb95b3c9838..cd6ef8cfba7367fec87dd238add23cfd365a5ceb 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -866,6 +866,7 @@ public final class CraftServer implements Server {
|
||||
@@ -861,6 +861,7 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
|
||||
org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot
|
||||
|
@ -444,7 +444,7 @@ index 6657edb762d234ab388b0bf7dd52f910e0e0af8b..d29c6d0536619fab5a48fbb52115dac0
|
|||
for (ServerLevel world : this.console.getAllLevels()) {
|
||||
world.serverLevelData.setDifficulty(config.difficulty);
|
||||
world.setSpawnSettings(config.spawnMonsters, config.spawnAnimals);
|
||||
@@ -881,12 +882,14 @@ public final class CraftServer implements Server {
|
||||
@@ -876,12 +877,14 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
}
|
||||
world.spigotConfig.init(); // Spigot
|
||||
|
@ -459,7 +459,7 @@ index 6657edb762d234ab388b0bf7dd52f910e0e0af8b..d29c6d0536619fab5a48fbb52115dac0
|
|||
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
||||
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
||||
|
||||
@@ -2331,4 +2334,35 @@ public final class CraftServer implements Server {
|
||||
@@ -2314,4 +2317,35 @@ public final class CraftServer implements Server {
|
||||
return this.spigot;
|
||||
}
|
||||
// Spigot end
|
||||
|
@ -496,7 +496,7 @@ index 6657edb762d234ab388b0bf7dd52f910e0e0af8b..d29c6d0536619fab5a48fbb52115dac0
|
|||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index e75ff70c52b097af447b7a91ef2c20c08a904d92..fae37b7b353cb7b0f8d4a79407fcc219a3c45b64 100644
|
||||
index e5008c75054df38356af193fd049110d7d56e2d4..c694c6dfed0b3aa098b1822676e39bd3eb04b45a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -129,6 +129,14 @@ public class Main {
|
284
patches/server/0005-MC-Dev-fixes.patch
Normal file
284
patches/server/0005-MC-Dev-fixes.patch
Normal file
File diff suppressed because one or more lines are too long
|
@ -17,17 +17,17 @@ Subject: [PATCH] CB fixes
|
|||
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
|
||||
index a480e20ac456a3169c67d2d43c191b7807a8ef10..1427b76110a02cee15865173e06e7b7bb4231ae7 100644
|
||||
index 5f7965076b14a694f644bf8fef9ba4f7b7a473ad..44f6e5cfdceb30934c2aafa85dc5492677d177d7 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -273,7 +273,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -289,7 +289,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
|
||||
long l = minecraftserver.getWorldData().worldGenSettings().seed();
|
||||
|
||||
- this.structureCheck = new StructureCheck(this.chunkSource.chunkScanner(), this.registryAccess(), minecraftserver.getStructureManager(), resourcekey, chunkgenerator, this, chunkgenerator.getBiomeSource(), l, datafixer);
|
||||
+ this.structureCheck = new StructureCheck(this.chunkSource.chunkScanner(), this.registryAccess(), minecraftserver.getStructureManager(), this.getTypeKey(), chunkgenerator, this, chunkgenerator.getBiomeSource(), l, datafixer); // Paper - Fix missing CB diff
|
||||
this.structureFeatureManager = new StructureFeatureManager(this, this.serverLevelData.worldGenSettings(), this.structureCheck); // CraftBukkit
|
||||
if (this.dimensionType().createDragonFight()) {
|
||||
- this.structureCheck = new StructureCheck(this.chunkSource.chunkScanner(), this.registryAccess(), minecraftserver.getStructureManager(), resourcekey, chunkgenerator, this.chunkSource.randomState(), this, chunkgenerator.getBiomeSource(), l, datafixer);
|
||||
+ this.structureCheck = new StructureCheck(this.chunkSource.chunkScanner(), this.registryAccess(), minecraftserver.getStructureManager(), this.getTypeKey(), chunkgenerator, this.chunkSource.randomState(), this, chunkgenerator.getBiomeSource(), l, datafixer); // Paper - Fix missing CB diff
|
||||
this.structureManager = new StructureManager(this, this.serverLevelData.worldGenSettings(), this.structureCheck); // CraftBukkit
|
||||
if (this.dimension() == Level.END && this.dimensionTypeRegistration().is(BuiltinDimensionTypes.END)) {
|
||||
this.dragonFight = new EndDragonFight(this, this.serverLevelData.worldGenSettings().seed(), this.serverLevelData.endDragonFightData()); // CraftBukkit
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Marker.java b/src/main/java/net/minecraft/world/entity/Marker.java
|
||||
index aef33a96cf8df9400cc60285ef1f7c5ded03b495..059c4c3b59f66ea2b2b23fe1eb106bf9447b607c 100644
|
||||
|
@ -45,32 +45,32 @@ index aef33a96cf8df9400cc60285ef1f7c5ded03b495..059c4c3b59f66ea2b2b23fe1eb106bf9
|
|||
|
||||
@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
|
||||
index ac1373b8c4411298f881f9d569bf984704eeadc4..469d3d7fb69829595abd221c700fcf79d2c42fd0 100644
|
||||
index 9998e1c94b72b90dd3ba4bcce1b4b3653b9b1b2b..963ad3ce1ef83888ae1537ff01accdbb5b04ffa1 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java
|
||||
@@ -45,7 +45,7 @@ public class StructureCheck {
|
||||
@@ -43,7 +43,7 @@ public class StructureCheck {
|
||||
private final Registry<Biome> biomes;
|
||||
private final Registry<ConfiguredStructureFeature<?, ?>> structureConfigs;
|
||||
private final StructureManager structureManager;
|
||||
private final Registry<Structure> structureConfigs;
|
||||
private final StructureTemplateManager structureTemplateManager;
|
||||
- private final ResourceKey<Level> dimension;
|
||||
+ private final ResourceKey<net.minecraft.world.level.dimension.LevelStem> dimension; // Paper - fix missing CB diff
|
||||
private final ChunkGenerator chunkGenerator;
|
||||
private final RandomState randomState;
|
||||
private final LevelHeightAccessor heightAccessor;
|
||||
private final BiomeSource biomeSource;
|
||||
@@ -54,7 +54,7 @@ public class StructureCheck {
|
||||
private final Long2ObjectMap<Object2IntMap<ConfiguredStructureFeature<?, ?>>> loadedChunks = new Long2ObjectOpenHashMap<>();
|
||||
private final Map<ConfiguredStructureFeature<?, ?>, Long2BooleanMap> featureChecks = new HashMap<>();
|
||||
@@ -53,7 +53,7 @@ public class StructureCheck {
|
||||
private final Long2ObjectMap<Object2IntMap<Structure>> loadedChunks = new Long2ObjectOpenHashMap<>();
|
||||
private final Map<Structure, Long2BooleanMap> featureChecks = new HashMap<>();
|
||||
|
||||
- public StructureCheck(ChunkScanAccess chunkIoWorker, RegistryAccess registryManager, StructureManager structureManager, ResourceKey<Level> worldKey, ChunkGenerator chunkGenerator, LevelHeightAccessor world, BiomeSource biomeSource, long seed, DataFixer dataFixer) {
|
||||
+ public StructureCheck(ChunkScanAccess chunkIoWorker, RegistryAccess registryManager, StructureManager structureManager, ResourceKey<net.minecraft.world.level.dimension.LevelStem> worldKey, ChunkGenerator chunkGenerator, LevelHeightAccessor world, BiomeSource biomeSource, long seed, DataFixer dataFixer) { // Paper - fix missing CB diff
|
||||
- public StructureCheck(ChunkScanAccess chunkIoWorker, RegistryAccess registryManager, StructureTemplateManager structureTemplateManager, ResourceKey<Level> worldKey, ChunkGenerator chunkGenerator, RandomState noiseConfig, LevelHeightAccessor world, BiomeSource biomeSource, long seed, DataFixer dataFixer) {
|
||||
+ public StructureCheck(ChunkScanAccess chunkIoWorker, RegistryAccess registryManager, StructureTemplateManager structureTemplateManager, ResourceKey<net.minecraft.world.level.dimension.LevelStem> worldKey, ChunkGenerator chunkGenerator, RandomState noiseConfig, LevelHeightAccessor world, BiomeSource biomeSource, long seed, DataFixer dataFixer) { // Paper - fix missing CB diff
|
||||
this.storageAccess = chunkIoWorker;
|
||||
this.registryAccess = registryManager;
|
||||
this.structureManager = structureManager;
|
||||
this.structureTemplateManager = structureTemplateManager;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index d29c6d0536619fab5a48fbb52115dac09e7d7ca3..66e8fea6bd10af2e19a4f49c556e66a63e6205b6 100644
|
||||
index cd6ef8cfba7367fec87dd238add23cfd365a5ceb..daf5dc59a1883570569798630c4991e676e34c1c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2266,7 +2266,13 @@ public final class CraftServer implements Server {
|
||||
@@ -2249,7 +2249,13 @@ public final class CraftServer implements Server {
|
||||
Validate.notNull(key, "NamespacedKey cannot be null");
|
||||
|
||||
LootTables registry = this.getServer().getLootTables();
|
||||
|
@ -84,20 +84,6 @@ index d29c6d0536619fab5a48fbb52115dac09e7d7ca3..66e8fea6bd10af2e19a4f49c556e66a6
|
|||
+ // Paper end
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomWorldChunkManager.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomWorldChunkManager.java
|
||||
index 6f1855d1fed73b694b0eaf581231359a66ae48e2..0238db9d5ffebe597534ec283f173ee2da19946d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/generator/CustomWorldChunkManager.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomWorldChunkManager.java
|
||||
@@ -45,8 +45,7 @@ public class CustomWorldChunkManager extends BiomeSource {
|
||||
|
||||
@Override
|
||||
public BiomeSource withSeed(long seed) {
|
||||
- // TODO check method further
|
||||
- throw new UnsupportedOperationException("Cannot copy CustomWorldChunkManager");
|
||||
+ return this; // Paper - Since this doesn't take a seed, no need to throw UOE
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/permissions/CraftDefaultPermissions.java b/src/main/java/org/bukkit/craftbukkit/util/permissions/CraftDefaultPermissions.java
|
||||
index c93eec7a81ed83dc9190417dd51acb2780d3b60d..70d3949616c63038ad3e9bd1069db5ea2fb3f3b8 100644
|
|
@ -4429,10 +4429,10 @@ index 0000000000000000000000000000000000000000..4d3dc8fba51bf5c0dceb06744781d1df
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
|
||||
index c1af79f65a1a6ba970764983cf666cb4b7fe36de..307c930d6d295012c8ec6332314b4043befbdafd 100644
|
||||
index 9f1bd2de71381140736ef1dbcc5b75e8bdcee0e8..d7e22ddf89619b58516ccef1d75a4c33df61b73c 100644
|
||||
--- a/src/main/java/net/minecraft/Util.java
|
||||
+++ b/src/main/java/net/minecraft/Util.java
|
||||
@@ -104,7 +104,7 @@ public class Util {
|
||||
@@ -114,7 +114,7 @@ public class Util {
|
||||
}
|
||||
|
||||
public static long getNanos() {
|
||||
|
@ -4442,7 +4442,7 @@ index c1af79f65a1a6ba970764983cf666cb4b7fe36de..307c930d6d295012c8ec6332314b4043
|
|||
|
||||
public static long getEpochMillis() {
|
||||
diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java
|
||||
index 79c7e30d510bdbd4def3b03474f72af0f355091c..d425adc1f37b9f926d6ee0c90d2237d89355e1a6 100644
|
||||
index c94084aee70d269a71a5423c13a5eba2babd9a6b..abd6fcab220d5616131e5bdd2f6a68a9105b7891 100644
|
||||
--- a/src/main/java/net/minecraft/core/BlockPos.java
|
||||
+++ b/src/main/java/net/minecraft/core/BlockPos.java
|
||||
@@ -531,6 +531,7 @@ public class BlockPos extends Vec3i {
|
||||
|
@ -5016,10 +5016,10 @@ index 0000000000000000000000000000000000000000..9f292deee1b793d52b5774304318e940
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 868f6799a0e406401eecf18bc939fbdf88f534a2..dd8d14a1b128f801a4e1c811de5990d2602feeb2 100644
|
||||
index 46fb83911e353f3682a250e62c4ecd7aceabaff8..c763b4d9cc16f8c3ced91ce8656bd238205dedc0 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -294,6 +294,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -279,6 +279,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
private static final int SAMPLE_INTERVAL = 100;
|
||||
public final double[] recentTps = new double[ 3 ];
|
||||
// Spigot end
|
||||
|
@ -5027,7 +5027,7 @@ index 868f6799a0e406401eecf18bc939fbdf88f534a2..dd8d14a1b128f801a4e1c811de5990d2
|
|||
|
||||
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
|
||||
AtomicReference<S> atomicreference = new AtomicReference();
|
||||
@@ -961,6 +962,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -918,6 +919,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
MinecraftServer.LOGGER.error("Failed to unlock level {}", this.storageSource.getLevelId(), ioexception1);
|
||||
}
|
||||
// Spigot start
|
||||
|
@ -5037,15 +5037,15 @@ index 868f6799a0e406401eecf18bc939fbdf88f534a2..dd8d14a1b128f801a4e1c811de5990d2
|
|||
if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) {
|
||||
MinecraftServer.LOGGER.info("Saving usercache.json");
|
||||
this.getProfileCache().save();
|
||||
@@ -1023,6 +1027,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.lastOverloadWarning = this.nextTickTime;
|
||||
}
|
||||
@@ -984,6 +988,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.lastOverloadWarning = this.nextTickTime;
|
||||
}
|
||||
|
||||
+ ++MinecraftServer.currentTickLong; // Paper
|
||||
if ( tickCount++ % MinecraftServer.SAMPLE_INTERVAL == 0 )
|
||||
{
|
||||
double currentTps = 1E3 / ( curTime - tickSection ) * MinecraftServer.SAMPLE_INTERVAL;
|
||||
@@ -1264,7 +1269,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
+ ++MinecraftServer.currentTickLong; // Paper
|
||||
if ( tickCount++ % MinecraftServer.SAMPLE_INTERVAL == 0 )
|
||||
{
|
||||
double currentTps = 1E3 / ( curTime - tickSection ) * MinecraftServer.SAMPLE_INTERVAL;
|
||||
@@ -1222,7 +1227,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
MinecraftServer.LOGGER.debug("Autosave finished");
|
||||
SpigotTimings.worldSaveTimer.stopTiming(); // Spigot
|
||||
}
|
||||
|
@ -5054,7 +5054,7 @@ index 868f6799a0e406401eecf18bc939fbdf88f534a2..dd8d14a1b128f801a4e1c811de5990d2
|
|||
this.profiler.push("tallying");
|
||||
long l = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i;
|
||||
|
||||
@@ -1326,6 +1331,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1284,6 +1289,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
try {
|
||||
worldserver.timings.doTick.startTiming(); // Spigot
|
||||
worldserver.tick(shouldKeepTicking);
|
||||
|
@ -5067,7 +5067,7 @@ index 868f6799a0e406401eecf18bc939fbdf88f534a2..dd8d14a1b128f801a4e1c811de5990d2
|
|||
} catch (Throwable throwable) {
|
||||
// Spigot Start
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
index a6dc73ddb58465667b9e227bece32f2952aa2270..e9523a7a3e1c6ee944ba539b952c8f25350bf815 100644
|
||||
index f902b1f7062fc2c81e0ce43e8b8599192469e57c..90fcb4dc89643b1c706ea4554595a842198558a1 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
@@ -52,9 +52,9 @@ public class ChunkHolder {
|
||||
|
@ -5181,7 +5181,7 @@ index a6dc73ddb58465667b9e227bece32f2952aa2270..e9523a7a3e1c6ee944ba539b952c8f25
|
|||
return this.chunkToSave;
|
||||
}
|
||||
|
||||
@@ -356,11 +388,11 @@ public class ChunkHolder {
|
||||
@@ -360,11 +392,11 @@ public class ChunkHolder {
|
||||
return ChunkHolder.getFullChunkStatus(this.ticketLevel);
|
||||
}
|
||||
|
||||
|
@ -5195,7 +5195,7 @@ index a6dc73ddb58465667b9e227bece32f2952aa2270..e9523a7a3e1c6ee944ba539b952c8f25
|
|||
return this.ticketLevel;
|
||||
}
|
||||
|
||||
@@ -449,14 +481,27 @@ public class ChunkHolder {
|
||||
@@ -453,14 +485,27 @@ public class ChunkHolder {
|
||||
|
||||
this.wasAccessibleSinceLastSave |= flag3;
|
||||
if (!flag2 && flag3) {
|
||||
|
@ -5223,7 +5223,7 @@ index a6dc73ddb58465667b9e227bece32f2952aa2270..e9523a7a3e1c6ee944ba539b952c8f25
|
|||
}
|
||||
|
||||
boolean flag4 = playerchunk_state.isOrAfter(ChunkHolder.FullChunkStatus.TICKING);
|
||||
@@ -465,12 +510,29 @@ public class ChunkHolder {
|
||||
@@ -469,12 +514,29 @@ public class ChunkHolder {
|
||||
if (!flag4 && flag5) {
|
||||
this.tickingChunkFuture = chunkStorage.prepareTickingChunk(this);
|
||||
this.scheduleFullChunkPromotion(chunkStorage, this.tickingChunkFuture, executor, ChunkHolder.FullChunkStatus.TICKING);
|
||||
|
@ -5254,7 +5254,7 @@ index a6dc73ddb58465667b9e227bece32f2952aa2270..e9523a7a3e1c6ee944ba539b952c8f25
|
|||
}
|
||||
|
||||
boolean flag6 = playerchunk_state.isOrAfter(ChunkHolder.FullChunkStatus.ENTITY_TICKING);
|
||||
@@ -483,12 +545,28 @@ public class ChunkHolder {
|
||||
@@ -487,12 +549,28 @@ public class ChunkHolder {
|
||||
|
||||
this.entityTickingChunkFuture = chunkStorage.prepareEntityTickingChunk(this.pos);
|
||||
this.scheduleFullChunkPromotion(chunkStorage, this.entityTickingChunkFuture, executor, ChunkHolder.FullChunkStatus.ENTITY_TICKING);
|
||||
|
@ -5284,7 +5284,7 @@ index a6dc73ddb58465667b9e227bece32f2952aa2270..e9523a7a3e1c6ee944ba539b952c8f25
|
|||
}
|
||||
|
||||
if (!playerchunk_state1.isOrAfter(playerchunk_state)) {
|
||||
@@ -604,4 +682,18 @@ public class ChunkHolder {
|
||||
@@ -608,4 +686,18 @@ public class ChunkHolder {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -5304,7 +5304,7 @@ index a6dc73ddb58465667b9e227bece32f2952aa2270..e9523a7a3e1c6ee944ba539b952c8f25
|
|||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index aa9bde92a48ab151145c3b0a77aa8beb6ecc1b5e..d9202f7a5b17d8a5c063c8aba4ce22a53d8f59af 100644
|
||||
index 775e34f6abd2fd703a284a85d975d48cd1930ad9..ef23f9f81a909348ee4ae3d7eb51dbcc430530ca 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -62,6 +62,7 @@ import net.minecraft.network.protocol.game.ClientboundSetChunkCacheCenterPacket;
|
||||
|
@ -5315,7 +5315,7 @@ index aa9bde92a48ab151145c3b0a77aa8beb6ecc1b5e..d9202f7a5b17d8a5c063c8aba4ce22a5
|
|||
import net.minecraft.server.level.progress.ChunkProgressListener;
|
||||
import net.minecraft.server.network.ServerPlayerConnection;
|
||||
import net.minecraft.util.CsvOutput;
|
||||
@@ -162,6 +163,56 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -167,6 +168,56 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
};
|
||||
// CraftBukkit end
|
||||
|
||||
|
@ -5369,12 +5369,12 @@ index aa9bde92a48ab151145c3b0a77aa8beb6ecc1b5e..d9202f7a5b17d8a5c063c8aba4ce22a5
|
|||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureManager structureManager, 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);
|
||||
this.visibleChunkMap = this.updatingChunkMap.clone();
|
||||
@@ -198,6 +249,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -211,6 +262,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
this.overworldDataStorage = persistentStateManagerFactory;
|
||||
this.poiManager = new PoiManager(path.resolve("poi"), dataFixer, dsync, world);
|
||||
this.poiManager = new PoiManager(path.resolve("poi"), dataFixer, dsync, world.registryAccess(), world);
|
||||
this.setViewDistance(viewDistance);
|
||||
+ // Paper start
|
||||
+ this.dataRegionManager = new io.papermc.paper.chunk.SingleThreadChunkRegionManager(this.level, 2, (1.0 / 3.0), 1, 6, "Data", DataRegionData::new, DataRegionSectionData::new);
|
||||
|
@ -5383,7 +5383,7 @@ index aa9bde92a48ab151145c3b0a77aa8beb6ecc1b5e..d9202f7a5b17d8a5c063c8aba4ce22a5
|
|||
}
|
||||
|
||||
protected ChunkGenerator generator() {
|
||||
@@ -287,6 +342,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -304,6 +359,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5398,7 +5398,7 @@ index aa9bde92a48ab151145c3b0a77aa8beb6ecc1b5e..d9202f7a5b17d8a5c063c8aba4ce22a5
|
|||
private CompletableFuture<Either<List<ChunkAccess>, ChunkHolder.ChunkLoadingFailure>> getChunkRangeFuture(ChunkPos centerChunk, int margin, IntFunction<ChunkStatus> distanceToStatus) {
|
||||
List<CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>>> list = new ArrayList();
|
||||
List<ChunkHolder> list1 = new ArrayList();
|
||||
@@ -418,6 +481,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -435,6 +498,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
holder.setTicketLevel(level);
|
||||
} else {
|
||||
holder = new ChunkHolder(new ChunkPos(pos), level, this.level, this.lightEngine, this.queueSorter, this);
|
||||
|
@ -5410,7 +5410,7 @@ index aa9bde92a48ab151145c3b0a77aa8beb6ecc1b5e..d9202f7a5b17d8a5c063c8aba4ce22a5
|
|||
}
|
||||
|
||||
this.updatingChunkMap.put(pos, holder);
|
||||
@@ -535,7 +603,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -552,7 +620,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
if (completablefuture1 != completablefuture) {
|
||||
this.scheduleUnload(pos, holder);
|
||||
} else {
|
||||
|
@ -5425,7 +5425,7 @@ index aa9bde92a48ab151145c3b0a77aa8beb6ecc1b5e..d9202f7a5b17d8a5c063c8aba4ce22a5
|
|||
if (ichunkaccess instanceof LevelChunk) {
|
||||
((LevelChunk) ichunkaccess).setLoaded(false);
|
||||
}
|
||||
@@ -551,7 +625,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -568,7 +642,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
this.lightEngine.tryScheduleUpdate();
|
||||
this.progressListener.onStatusChange(ichunkaccess.getPos(), (ChunkStatus) null);
|
||||
this.chunkSaveCooldowns.remove(ichunkaccess.getPos().toLong());
|
||||
|
@ -5437,15 +5437,15 @@ index aa9bde92a48ab151145c3b0a77aa8beb6ecc1b5e..d9202f7a5b17d8a5c063c8aba4ce22a5
|
|||
|
||||
}
|
||||
};
|
||||
@@ -1099,6 +1177,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1138,6 +1216,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
if (!flag1) {
|
||||
this.distanceManager.addPlayer(SectionPos.of((Entity) player), player);
|
||||
this.distanceManager.addPlayer(SectionPos.of((EntityAccess) player), player);
|
||||
}
|
||||
+ this.addPlayerToDistanceMaps(player); // Paper - distance maps
|
||||
} else {
|
||||
SectionPos sectionposition = player.getLastSectionPos();
|
||||
|
||||
@@ -1106,6 +1185,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1145,6 +1224,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
if (!flag2) {
|
||||
this.distanceManager.removePlayer(sectionposition, player);
|
||||
}
|
||||
|
@ -5453,7 +5453,7 @@ index aa9bde92a48ab151145c3b0a77aa8beb6ecc1b5e..d9202f7a5b17d8a5c063c8aba4ce22a5
|
|||
}
|
||||
|
||||
for (int k = i - this.viewDistance - 1; k <= i + this.viewDistance + 1; ++k) {
|
||||
@@ -1218,6 +1298,8 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1257,6 +1337,8 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5462,7 +5462,7 @@ index aa9bde92a48ab151145c3b0a77aa8beb6ecc1b5e..d9202f7a5b17d8a5c063c8aba4ce22a5
|
|||
}
|
||||
|
||||
@Override
|
||||
@@ -1421,7 +1503,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1460,7 +1542,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
public class ChunkDistanceManager extends DistanceManager {
|
||||
|
||||
protected ChunkDistanceManager(Executor workerExecutor, Executor mainThreadExecutor) {
|
||||
|
@ -5504,10 +5504,10 @@ index 6c98676827ceb6999f340fa2b06a0b3e1cb4cae2..f08089b8672454acf8c2309e850466b3
|
|||
|
||||
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
|
||||
index 7c034b62dbebbbc4c9c4ceb427b1509fe8f986e3..e4d0035bbf17008642cdcc0e1dca5bae832bbbaa 100644
|
||||
index d0b3fdec88ca7e8b1a57b742c1c9b785750123e8..b0c46312dfb00c13421bb643dbf246610aff897b 100644
|
||||
--- a/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;
|
||||
@@ -50,6 +50,7 @@ import net.minecraft.world.level.storage.LevelStorageSource;
|
||||
|
||||
public class ServerChunkCache extends ChunkSource {
|
||||
|
||||
|
@ -5515,7 +5515,7 @@ index 7c034b62dbebbbc4c9c4ceb427b1509fe8f986e3..e4d0035bbf17008642cdcc0e1dca5bae
|
|||
public static final List<ChunkStatus> CHUNK_STATUSES = ChunkStatus.getStatusList();
|
||||
private final DistanceManager distanceManager;
|
||||
final ServerLevel level;
|
||||
@@ -67,6 +68,334 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -68,6 +69,334 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@Nullable
|
||||
@VisibleForDebug
|
||||
private NaturalSpawner.SpawnState lastSpawnState;
|
||||
|
@ -5848,9 +5848,9 @@ index 7c034b62dbebbbc4c9c4ceb427b1509fe8f986e3..e4d0035bbf17008642cdcc0e1dca5bae
|
|||
+ final io.papermc.paper.util.maplist.IteratorSafeOrderedReferenceSet<LevelChunk> entityTickingChunks = new io.papermc.paper.util.maplist.IteratorSafeOrderedReferenceSet<>(4096, 0.75f, 4096, 0.15, true);
|
||||
+ // Paper end
|
||||
|
||||
public ServerChunkCache(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureManager structureManager, 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;
|
||||
@@ -119,6 +448,49 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -120,6 +449,49 @@ public class ServerChunkCache extends ChunkSource {
|
||||
this.lastChunk[0] = chunk;
|
||||
}
|
||||
|
||||
|
@ -5901,18 +5901,18 @@ index 7c034b62dbebbbc4c9c4ceb427b1509fe8f986e3..e4d0035bbf17008642cdcc0e1dca5bae
|
|||
@Override
|
||||
public ChunkAccess getChunk(int x, int z, ChunkStatus leastStatus, boolean create) {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 1427b76110a02cee15865173e06e7b7bb4231ae7..de0f49f3e9134c068aa479067ee2986c981167b8 100644
|
||||
index 44f6e5cfdceb30934c2aafa85dc5492677d177d7..501fd02fedf1a47da28d07fd04b63f89368723ce 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -160,6 +160,7 @@ import org.bukkit.event.server.MapInitializeEvent;
|
||||
import org.bukkit.event.weather.LightningStrikeEvent;
|
||||
@@ -166,6 +166,7 @@ import org.bukkit.event.weather.LightningStrikeEvent;
|
||||
import org.bukkit.event.world.GenericGameEvent;
|
||||
import org.bukkit.event.world.TimeSkipEvent;
|
||||
// CraftBukkit end
|
||||
+import it.unimi.dsi.fastutil.ints.IntArrayList; // Paper
|
||||
|
||||
public class ServerLevel extends Level implements WorldGenLevel {
|
||||
|
||||
@@ -216,6 +217,96 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -221,6 +222,96 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
return convertable.dimensionType;
|
||||
}
|
||||
|
||||
|
@ -6006,23 +6006,23 @@ index 1427b76110a02cee15865173e06e7b7bb4231ae7..de0f49f3e9134c068aa479067ee2986c
|
|||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
// Add env and gen to constructor, WorldData -> WorldDataServer
|
||||
public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, ServerLevelData iworlddataserver, ResourceKey<Level> resourcekey, Holder<DimensionType> holder, ChunkProgressListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List<CustomSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
|
||||
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
|
||||
// Add env and gen to constructor, IWorldDataServer -> WorldDataServer
|
||||
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, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
|
||||
// Holder holder = worlddimension.typeHolder(); // 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
|
||||
index 43e8ef374d88cc60642a3008792a8785fbefb75a..3431a70a07c08fdc20c7a8d667e6275f212b549e 100644
|
||||
index dde3ad5a7c5a127c16e493231a6fe4a5436b5615..56996af65ef7478adb90d3b2f4cd3351fc49200b 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -234,6 +234,8 @@ public class ServerPlayer extends Player {
|
||||
@@ -241,6 +241,8 @@ public class ServerPlayer extends Player {
|
||||
public String kickLeaveMessage = null; // SPIGOT-3034: Forward leave message to PlayerQuitEvent
|
||||
// CraftBukkit end
|
||||
|
||||
+ public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper
|
||||
+
|
||||
public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile) {
|
||||
super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile);
|
||||
public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, @Nullable ProfilePublicKey publicKey) {
|
||||
super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile, publicKey);
|
||||
this.chatVisibility = ChatVisiblity.FULL;
|
||||
@@ -297,6 +299,8 @@ public class ServerPlayer extends Player {
|
||||
@@ -304,6 +306,8 @@ public class ServerPlayer extends Player {
|
||||
this.maxUpStep = 1.0F;
|
||||
this.fudgeSpawnLocation(world);
|
||||
|
||||
|
@ -6044,10 +6044,10 @@ index 3a4f026c73cdd22d30bdadabbcf24bef969b73e4..0d536d72ac918fbd403397ff369d1014
|
|||
private final String name;
|
||||
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
|
||||
index 0d33910768b111863816f84393613c0cc5142691..8fdda1e5805534d08c0a06b15e89d85b3d9c21e9 100644
|
||||
index ced08665126a88d68ccd7cfb858b3268ab5680c2..ba3023c7dd5b3bcf66f829fe5dc9757f96d16b45 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
|
||||
@@ -151,6 +151,26 @@ public class WorldGenRegion implements WorldGenLevel {
|
||||
@@ -158,6 +158,26 @@ public class WorldGenRegion implements WorldGenLevel {
|
||||
return chunkX >= this.firstPos.x && chunkX <= this.lastPos.x && chunkZ >= this.firstPos.z && chunkZ <= this.lastPos.z;
|
||||
}
|
||||
|
||||
|
@ -6074,23 +6074,6 @@ index 0d33910768b111863816f84393613c0cc5142691..8fdda1e5805534d08c0a06b15e89d85b
|
|||
@Override
|
||||
public BlockState getBlockState(BlockPos pos) {
|
||||
return this.getChunk(SectionPos.blockToSectionCoord(pos.getX()), SectionPos.blockToSectionCoord(pos.getZ())).getBlockState(pos);
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 92ca91b804b8a06299b006c67006ff1f2cd44fd3..3d9a2d4ff540f02163edd023ff86815fda5a35b8 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -218,9 +218,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
private final MinecraftServer server;
|
||||
public ServerPlayer player;
|
||||
private int tickCount;
|
||||
- private long keepAliveTime;
|
||||
- private boolean keepAlivePending;
|
||||
- private long keepAliveChallenge;
|
||||
+ private long keepAliveTime; @Deprecated private void setLastPing(long lastPing) { this.keepAliveTime = lastPing;}; @Deprecated private long getLastPing() { return this.keepAliveTime;}; // Paper - OBFHELPER
|
||||
+ private boolean keepAlivePending; @Deprecated private void setPendingPing(boolean isPending) { this.keepAlivePending = isPending;}; @Deprecated private boolean isPendingPing() { return this.keepAlivePending;}; // Paper - OBFHELPER
|
||||
+ private long keepAliveChallenge; @Deprecated private void setKeepAliveID(long keepAliveID) { this.keepAliveChallenge = keepAliveID;}; @Deprecated private long getKeepAliveID() {return this.keepAliveChallenge; }; // Paper - OBFHELPER
|
||||
// CraftBukkit start - multithreaded fields
|
||||
private final AtomicInteger chatSpamTickCount = new AtomicInteger();
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java
|
||||
index 288fdbef407d11ab430d5d7026dfad148c3c1065..6fefa619299d3202158490630d62c16aef71e831 100644
|
||||
--- a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java
|
||||
|
@ -6110,10 +6093,10 @@ index 288fdbef407d11ab430d5d7026dfad148c3c1065..6fefa619299d3202158490630d62c16a
|
|||
@Override
|
||||
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
|
||||
index 7e4e947f2be4d5ef0f6f1b3eb10a5b8d5018e918..e99f7f5eae48e635f167744394ce559ea06971ea 100644
|
||||
index b878882dc03ebf1d2f5dcbd47cac7fea88b1caa2..277a9fc7b61361f472eae171a3546c85da4f30b4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -311,6 +311,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -314,6 +314,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
return this.level.hasChunk((int) Math.floor(this.getX()) >> 4, (int) Math.floor(this.getZ()) >> 4);
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
@ -6126,10 +6109,10 @@ index 7e4e947f2be4d5ef0f6f1b3eb10a5b8d5018e918..e99f7f5eae48e635f167744394ce559e
|
|||
public Entity(EntityType<?> type, Level world) {
|
||||
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
|
||||
index 2f5bd8d2dd2f185c8d1d397a6bd83b46071cc6f3..c2b768c949cbf8d5e1db5a99812eb31c47194e0e 100644
|
||||
index a7a5ab0e718d2ee81fd8d3585d2d92df591deb64..ba7037a44b2fba6aafcbc4081c5c481a2cdcfd3b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -258,6 +258,7 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -260,6 +260,7 @@ public abstract class LivingEntity extends Entity {
|
||||
public boolean collides = true;
|
||||
public Set<UUID> collidableExemptions = new HashSet<>();
|
||||
public boolean bukkitPickUpLoot;
|
||||
|
@ -6138,10 +6121,10 @@ index 2f5bd8d2dd2f185c8d1d397a6bd83b46071cc6f3..c2b768c949cbf8d5e1db5a99812eb31c
|
|||
@Override
|
||||
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
|
||||
index 0b4dd7b91faf293d876ee703207a96f7b0987f84..625641be06b7afafec59ce19ecd39c54bf840351 100644
|
||||
index 77a91fe6fd028291e9c66163714ab53f9cf031ed..decf753d088983ef6bbf32a32a6ee8d3cca3ee69 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -237,6 +237,7 @@ public abstract class Mob extends LivingEntity {
|
||||
@@ -242,6 +242,7 @@ public abstract class Mob extends LivingEntity {
|
||||
return this.target;
|
||||
}
|
||||
|
||||
|
@ -6150,7 +6133,7 @@ index 0b4dd7b91faf293d876ee703207a96f7b0987f84..625641be06b7afafec59ce19ecd39c54
|
|||
// CraftBukkit start - fire event
|
||||
this.setTarget(target, EntityTargetEvent.TargetReason.UNKNOWN, true);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/PathfinderMob.java b/src/main/java/net/minecraft/world/entity/PathfinderMob.java
|
||||
index 422b4730a99541b1fa64c439ec126c0cef1f3cb1..ff458abb221daaddaa734811eaaa35ea43883343 100644
|
||||
index dc8f9714311248bce3facbd879667e4c395fd5e2..2df5b50be11297941d13ec9d17001f488af11750 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/PathfinderMob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/PathfinderMob.java
|
||||
@@ -18,6 +18,8 @@ public abstract class PathfinderMob extends Mob {
|
||||
|
@ -6163,11 +6146,11 @@ index 422b4730a99541b1fa64c439ec126c0cef1f3cb1..ff458abb221daaddaa734811eaaa35ea
|
|||
return this.getWalkTargetValue(pos, this.level);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Monster.java b/src/main/java/net/minecraft/world/entity/monster/Monster.java
|
||||
index 6c3044b6194dfd3037389d717bbe6783f58b951d..457880c9e894a83d88505cf0b7235df919eea591 100644
|
||||
index a0b5895abc88d297045e05f25bb09527991d43f0..6e0bd0eab0b06a4ac3042496bbb91292544e9f3c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Monster.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Monster.java
|
||||
@@ -26,6 +26,7 @@ import net.minecraft.world.level.LightLayer;
|
||||
import net.minecraft.world.level.ServerLevelAccessor;
|
||||
@@ -27,6 +27,7 @@ import net.minecraft.world.level.ServerLevelAccessor;
|
||||
import net.minecraft.world.level.dimension.DimensionType;
|
||||
|
||||
public abstract class Monster extends PathfinderMob implements Enemy {
|
||||
+ public org.bukkit.craftbukkit.entity.CraftMonster getBukkitMonster() { return (org.bukkit.craftbukkit.entity.CraftMonster) super.getBukkitEntity(); } // Paper
|
||||
|
@ -6175,10 +6158,10 @@ index 6c3044b6194dfd3037389d717bbe6783f58b951d..457880c9e894a83d88505cf0b7235df9
|
|||
super(type, world);
|
||||
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
|
||||
index 62253b9fac567b515bafa06d00c6583b9ac1e216..1a52db84d9630a095347a85e136a9ad118f77325 100644
|
||||
index e7e831f0e179ec6740e6a5271d63a76a3d699159..7f778e037c1821cc45236bf2a95c28243d0ec126 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -737,6 +737,25 @@ public final class ItemStack {
|
||||
@@ -751,6 +751,25 @@ public final class ItemStack {
|
||||
return this.tag != null ? this.tag.getList("Enchantments", 10) : new ListTag();
|
||||
}
|
||||
|
||||
|
@ -6204,7 +6187,7 @@ index 62253b9fac567b515bafa06d00c6583b9ac1e216..1a52db84d9630a095347a85e136a9ad1
|
|||
public void setTag(@Nullable CompoundTag nbt) {
|
||||
this.tag = nbt;
|
||||
if (this.getItem().canBeDepleted()) {
|
||||
@@ -1135,6 +1154,7 @@ public final class ItemStack {
|
||||
@@ -1133,6 +1152,7 @@ public final class ItemStack {
|
||||
// CraftBukkit start
|
||||
@Deprecated
|
||||
public void setItem(Item item) {
|
||||
|
@ -6250,18 +6233,18 @@ index 76251b5adf41f8e5bf2c07145abe3108fcde8669..8a979600b49e8a11982577fb6dd79503
|
|||
FluidState getFluidState(BlockPos pos);
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/ChunkPos.java b/src/main/java/net/minecraft/world/level/ChunkPos.java
|
||||
index 788f92f1ede5a6fbf47f65d6c69a7b631c9456ac..4335132883e959f0c9649d5640b703a291d8a7aa 100644
|
||||
index a3040440ed34a1c2adca2d57d458504a4a48282f..2d41f619577b41d6420159668bbab70fb6c762eb 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/ChunkPos.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/ChunkPos.java
|
||||
@@ -18,6 +18,7 @@ public class ChunkPos {
|
||||
private static final int REGION_MASK = 31;
|
||||
@@ -20,6 +20,7 @@ public class ChunkPos {
|
||||
public static final int REGION_MAX_INDEX = 31;
|
||||
public final int x;
|
||||
public final int z;
|
||||
+ public final long longKey; // Paper
|
||||
private static final int HASH_A = 1664525;
|
||||
private static final int HASH_C = 1013904223;
|
||||
private static final int HASH_Z_XOR = -559038737;
|
||||
@@ -25,23 +26,26 @@ public class ChunkPos {
|
||||
@@ -27,16 +28,19 @@ public class ChunkPos {
|
||||
public ChunkPos(int x, int z) {
|
||||
this.x = x;
|
||||
this.z = z;
|
||||
|
@ -6280,6 +6263,10 @@ index 788f92f1ede5a6fbf47f65d6c69a7b631c9456ac..4335132883e959f0c9649d5640b703a2
|
|||
+ this.longKey = asLong(this.x, this.z); // Paper
|
||||
}
|
||||
|
||||
public static ChunkPos minFromRegion(int x, int z) {
|
||||
@@ -48,10 +52,10 @@ public class ChunkPos {
|
||||
}
|
||||
|
||||
public long toLong() {
|
||||
- return asLong(this.x, this.z);
|
||||
+ return longKey; // Paper
|
||||
|
@ -6314,10 +6301,10 @@ index 3c707d6674b2594b09503b959a31c1f4ad3981e6..db61b6b0158a9bcc0e1d735e34fe3671
|
|||
public BlockState getBlockState(BlockPos pos) {
|
||||
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
|
||||
index 6ded806628f2f3fd5b357eed41990abd7e06a372..47f625a30f3f2aa95d94f571abf5af95eee68912 100644
|
||||
index 5576da91821926cdd9c5ef09534deb843986d202..914e42e983d56d9c85b1583f57afab699054f4d6 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -83,6 +83,7 @@ import org.bukkit.craftbukkit.CraftServer;
|
||||
@@ -85,6 +85,7 @@ import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.CraftWorld;
|
||||
import org.bukkit.craftbukkit.SpigotTimings; // Spigot
|
||||
import org.bukkit.craftbukkit.block.CapturedBlockState;
|
||||
|
@ -6325,7 +6312,7 @@ index 6ded806628f2f3fd5b357eed41990abd7e06a372..47f625a30f3f2aa95d94f571abf5af95
|
|||
import org.bukkit.craftbukkit.block.data.CraftBlockData;
|
||||
import org.bukkit.craftbukkit.util.CraftSpawnCategory;
|
||||
import org.bukkit.craftbukkit.util.CraftNamespacedKey;
|
||||
@@ -269,18 +270,51 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -280,18 +281,51 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
return y < -20000000 || y >= 20000000;
|
||||
}
|
||||
|
||||
|
@ -6381,7 +6368,7 @@ index 6ded806628f2f3fd5b357eed41990abd7e06a372..47f625a30f3f2aa95d94f571abf5af95
|
|||
ChunkAccess ichunkaccess = this.getChunkSource().getChunk(chunkX, chunkZ, leastStatus, create);
|
||||
|
||||
if (ichunkaccess == null && create) {
|
||||
@@ -291,7 +325,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -302,7 +336,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6390,7 +6377,7 @@ index 6ded806628f2f3fd5b357eed41990abd7e06a372..47f625a30f3f2aa95d94f571abf5af95
|
|||
return this.setBlock(pos, state, flags, 512);
|
||||
}
|
||||
|
||||
@@ -596,7 +630,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -546,7 +580,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
if (this.isOutsideBuildHeight(pos)) {
|
||||
return Blocks.VOID_AIR.defaultBlockState();
|
||||
} else {
|
||||
|
@ -6400,7 +6387,7 @@ index 6ded806628f2f3fd5b357eed41990abd7e06a372..47f625a30f3f2aa95d94f571abf5af95
|
|||
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
|
||||
index fb6ee169e6faa0dfc402f414ada10abbad57189e..34b26ee897209034c9be4d3e61acfd18d59e5e1e 100644
|
||||
index 6d32473b64df28dfe0e668df7abb58d930d14005..4404fa3a083d7ef4578244c924fa4859b9b6edfd 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/LevelReader.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/LevelReader.java
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.world.level.levelgen.Heightmap;
|
||||
|
@ -6464,10 +6451,10 @@ index ccf37eb05846f825d9acc874455cbbcdcdd2ecc2..138f5576a1df6714e754d9829f209f1a
|
|||
public WorldBorder 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
|
||||
index 42d68e0df3ff4476a248044c7a727c0c2d3b828a..2b88ea323b7e179015751e87d1a4303bffed7f51 100644
|
||||
index 6aba60bc79d373f098e97a7f9d8be0a78fb776a3..06525d7687fec5b37cd6020ad1bac998b194e89f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
@@ -646,14 +646,14 @@ public abstract class BlockBehaviour {
|
||||
@@ -658,14 +658,14 @@ public abstract class BlockBehaviour {
|
||||
|
||||
public abstract static class BlockStateBase extends StateHolder<Block, BlockState> {
|
||||
|
||||
|
@ -6485,8 +6472,8 @@ index 42d68e0df3ff4476a248044c7a727c0c2d3b828a..2b88ea323b7e179015751e87d1a4303b
|
|||
private final BlockBehaviour.StatePredicate isRedstoneConductor;
|
||||
private final BlockBehaviour.StatePredicate isSuffocating;
|
||||
private final BlockBehaviour.StatePredicate isViewBlocking;
|
||||
@@ -681,10 +681,18 @@ public abstract class BlockBehaviour {
|
||||
this.emissiveRendering = blockbase_info.emissiveRendering;
|
||||
@@ -695,10 +695,18 @@ public abstract class BlockBehaviour {
|
||||
this.offsetType = (BlockBehaviour.OffsetType) blockbase_info.offsetType.apply(this.asState());
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
|
@ -6504,7 +6491,7 @@ index 42d68e0df3ff4476a248044c7a727c0c2d3b828a..2b88ea323b7e179015751e87d1a4303b
|
|||
|
||||
}
|
||||
|
||||
@@ -716,8 +724,8 @@ public abstract class BlockBehaviour {
|
||||
@@ -734,8 +742,8 @@ public abstract class BlockBehaviour {
|
||||
return this.getBlock().getOcclusionShape(this.asState(), world, pos);
|
||||
}
|
||||
|
||||
|
@ -6516,10 +6503,10 @@ index 42d68e0df3ff4476a248044c7a727c0c2d3b828a..2b88ea323b7e179015751e87d1a4303b
|
|||
|
||||
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
|
||||
index b629ce7f1aa4592748f3f47ae3637b20461549d2..847ac56f20ab9c5745f9c0fa0e6f16743ba5e471 100644
|
||||
index e71e0c7b00fa8ce2cbac9f17ac00902b05823809..91d2939bde77c52c25d2633dacc461d7284ef2d3 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
|
||||
@@ -61,7 +61,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
|
||||
@@ -58,7 +58,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
|
||||
protected final ShortList[] postProcessing;
|
||||
protected volatile boolean unsaved;
|
||||
private volatile boolean isLightCorrect;
|
||||
|
@ -6528,7 +6515,7 @@ index b629ce7f1aa4592748f3f47ae3637b20461549d2..847ac56f20ab9c5745f9c0fa0e6f1674
|
|||
private long inhabitedTime;
|
||||
/** @deprecated */
|
||||
@Nullable
|
||||
@@ -86,7 +86,8 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
|
||||
@@ -83,7 +83,8 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
|
||||
// CraftBukkit end
|
||||
|
||||
public ChunkAccess(ChunkPos pos, UpgradeData upgradeData, LevelHeightAccessor heightLimitView, Registry<Biome> biome, long inhabitedTime, @Nullable LevelChunkSection[] sectionArrayInitializer, @Nullable BlendingData blendingData) {
|
||||
|
@ -6539,7 +6526,7 @@ index b629ce7f1aa4592748f3f47ae3637b20461549d2..847ac56f20ab9c5745f9c0fa0e6f1674
|
|||
this.levelHeightAccessor = heightLimitView;
|
||||
this.sections = new LevelChunkSection[heightLimitView.getSectionsCount()];
|
||||
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 5015d09de59cf184c98b1ea45f25a264c6dab1b1..73a99db6c31dec822514392a6102b7f8cc3b2738 100644
|
||||
index e518e8e417f2eee43ff0847c24b6858054e7c9a9..ab986a3d1dc2f605b5b84d2b62cd97007e3a2c22 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -25,6 +25,7 @@ import net.minecraft.nbt.CompoundTag;
|
||||
|
@ -6661,7 +6648,7 @@ index 5015d09de59cf184c98b1ea45f25a264c6dab1b1..73a99db6c31dec822514392a6102b7f8
|
|||
public LevelChunk(ServerLevel world, ProtoChunk protoChunk, @Nullable LevelChunk.PostLoadProcessor entityLoader) {
|
||||
this(world, protoChunk.getPos(), protoChunk.getUpgradeData(), protoChunk.unpackBlockTicks(), protoChunk.unpackFluidTicks(), protoChunk.getInhabitedTime(), protoChunk.getSections(), entityLoader, protoChunk.getBlendingData());
|
||||
Iterator iterator = protoChunk.getBlockEntities().values().iterator();
|
||||
@@ -225,6 +330,18 @@ public class LevelChunk extends ChunkAccess {
|
||||
@@ -233,6 +338,18 @@ public class LevelChunk extends ChunkAccess {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6680,7 +6667,7 @@ index 5015d09de59cf184c98b1ea45f25a264c6dab1b1..73a99db6c31dec822514392a6102b7f8
|
|||
@Override
|
||||
public FluidState getFluidState(BlockPos pos) {
|
||||
return this.getFluidState(pos.getX(), pos.getY(), pos.getZ());
|
||||
@@ -346,6 +463,7 @@ public class LevelChunk extends ChunkAccess {
|
||||
@@ -354,6 +471,7 @@ public class LevelChunk extends ChunkAccess {
|
||||
return this.getBlockEntity(pos, LevelChunk.EntityCreationType.CHECK);
|
||||
}
|
||||
|
||||
|
@ -6688,7 +6675,7 @@ index 5015d09de59cf184c98b1ea45f25a264c6dab1b1..73a99db6c31dec822514392a6102b7f8
|
|||
@Nullable
|
||||
public BlockEntity getBlockEntity(BlockPos pos, LevelChunk.EntityCreationType creationType) {
|
||||
// CraftBukkit start
|
||||
@@ -515,7 +633,25 @@ public class LevelChunk extends ChunkAccess {
|
||||
@@ -535,7 +653,25 @@ public class LevelChunk extends ChunkAccess {
|
||||
|
||||
// CraftBukkit start
|
||||
public void loadCallback() {
|
||||
|
@ -6714,7 +6701,7 @@ index 5015d09de59cf184c98b1ea45f25a264c6dab1b1..73a99db6c31dec822514392a6102b7f8
|
|||
if (server != null) {
|
||||
/*
|
||||
* If it's a new world, the first few chunks are generated inside
|
||||
@@ -554,6 +690,22 @@ public class LevelChunk extends ChunkAccess {
|
||||
@@ -574,6 +710,22 @@ public class LevelChunk extends ChunkAccess {
|
||||
server.getPluginManager().callEvent(unloadEvent);
|
||||
// note: saving can be prevented, but not forced if no saving is actually required
|
||||
this.mustNotSave = !unloadEvent.isSaveChunk();
|
||||
|
@ -6738,7 +6725,7 @@ index 5015d09de59cf184c98b1ea45f25a264c6dab1b1..73a99db6c31dec822514392a6102b7f8
|
|||
|
||||
@Override
|
||||
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 28e02151cb56141545c27d0cd9723e742fc420ad..ee0be5163811ea39efcb2092e5f126c3fd9b1523 100644
|
||||
index c5af1f7521d87fd5344e01e034c16065ca60d962..3b11824a1b85da437eec108f631eacfb5192459e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
|
||||
@@ -74,6 +74,18 @@ public class ProtoChunk extends ChunkAccess {
|
||||
|
@ -6983,7 +6970,7 @@ 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
|
||||
index c7b636889cef5c4b3bf0abc3cbf9873baa4f60ad..6e990ab85b1510a952de931a0ae4f5b6356da13f 100644
|
||||
index 3e5aba82640e6e5b55c5dc873019b6a36457dd2b..0d0a5b436ff68d49cf7a043127818bd474562b4b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -100,8 +100,17 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
|
@ -7020,10 +7007,10 @@ index c7b636889cef5c4b3bf0abc3cbf9873baa4f60ad..6e990ab85b1510a952de931a0ae4f5b6
|
|||
|
||||
public static byte toLegacyData(BlockState data) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
|
||||
index b8d50fd20fea9f84af77de69391d670c7b6cf132..13e887e9d06c3eb8649613d1ecb3d26de6b9d6ef 100644
|
||||
index 06da639663ead833c620a03d47fa9169c4509183..3bedc22c253c3632b5624c05e78ed3671e5d30ce 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
|
||||
@@ -205,7 +205,23 @@ public class DummyGeneratorAccess implements WorldGenLevel {
|
||||
@@ -208,7 +208,23 @@ public class DummyGeneratorAccess implements WorldGenLevel {
|
||||
public FluidState getFluidState(BlockPos pos) {
|
||||
return Fluids.EMPTY.defaultFluidState(); // SPIGOT-6634
|
||||
}
|
|
@ -1059,10 +1059,10 @@ index 0000000000000000000000000000000000000000..2dc92d8d2764d3e9b621d5c7d5e30c30
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/ChatFormatting.java b/src/main/java/net/minecraft/ChatFormatting.java
|
||||
index 9143392884801e952a96cb5e7b761c7a827fa648..3a13544bc3b8f8dc6a38aacb6af99b25365dd6d1 100644
|
||||
index 98f2def9125d6faf5859572a004fa8d2fa066417..436f381c727cda72c04859c540dce4715b445390 100644
|
||||
--- a/src/main/java/net/minecraft/ChatFormatting.java
|
||||
+++ b/src/main/java/net/minecraft/ChatFormatting.java
|
||||
@@ -110,6 +110,18 @@ public enum ChatFormatting {
|
||||
@@ -113,6 +113,18 @@ public enum ChatFormatting implements StringRepresentable {
|
||||
return name == null ? null : FORMATTING_BY_NAME.get(cleanName(name));
|
||||
}
|
||||
|
||||
|
@ -1082,10 +1082,10 @@ index 9143392884801e952a96cb5e7b761c7a827fa648..3a13544bc3b8f8dc6a38aacb6af99b25
|
|||
public static ChatFormatting getById(int colorIndex) {
|
||||
if (colorIndex < 0) {
|
||||
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||
index d5d94ea8070ab5f66f0a3244a5a953b9c9d5c527..0053474ab7c25de6d86c16e3079feb21f75d1c11 100644
|
||||
index c4854debe11b8bb61fa49c76c1854f94c1e7777f..42514a0c7066dc79050c0496d6463528b593f9e4 100644
|
||||
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||
@@ -14,6 +14,7 @@ import io.netty.handler.codec.EncoderException;
|
||||
@@ -18,6 +18,7 @@ import io.netty.handler.codec.EncoderException;
|
||||
import io.netty.util.ByteProcessor;
|
||||
import it.unimi.dsi.fastutil.ints.IntArrayList;
|
||||
import it.unimi.dsi.fastutil.ints.IntList;
|
||||
|
@ -1093,16 +1093,16 @@ index d5d94ea8070ab5f66f0a3244a5a953b9c9d5c527..0053474ab7c25de6d86c16e3079feb21
|
|||
import java.io.DataOutput;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
@@ -61,6 +62,7 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||
@@ -75,6 +76,7 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||
private static final int MAX_VARLONG_SIZE = 10;
|
||||
private static final int DEFAULT_NBT_QUOTA = 2097152;
|
||||
private final ByteBuf source;
|
||||
+ public java.util.Locale adventure$locale; // Paper
|
||||
public static final short MAX_STRING_LENGTH = 32767;
|
||||
public static final int MAX_COMPONENT_STRING_LENGTH = 262144;
|
||||
|
||||
@@ -350,8 +352,15 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||
return Component.Serializer.fromJson(this.readUtf(262144));
|
||||
private static final int PUBLIC_KEY_SIZE = 256;
|
||||
@@ -433,8 +435,15 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||
}
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
|
@ -1139,7 +1139,7 @@ index 021a26a6b1c258deffc26c035ab52a4ea027d9a1..00d432bd395e7f7fb6ee24e371818d13
|
|||
try {
|
||||
int i = friendlyByteBuf.writerIndex();
|
||||
diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java
|
||||
index 4d664338f3d5570fd0133ace6b297d70045b34a7..984105c226f16746b43bb2d2932e0b87f3a6a70c 100644
|
||||
index d19b8ccc791c3f135603b950008136ae6d2f0bfb..bbfb98618a0b87406cc48465bdda15a0a4974b7e 100644
|
||||
--- a/src/main/java/net/minecraft/network/chat/Component.java
|
||||
+++ b/src/main/java/net/minecraft/network/chat/Component.java
|
||||
@@ -1,6 +1,7 @@
|
||||
|
@ -1150,7 +1150,7 @@ index 4d664338f3d5570fd0133ace6b297d70045b34a7..984105c226f16746b43bb2d2932e0b87
|
|||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
@@ -161,6 +162,7 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
||||
@@ -200,6 +201,7 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
||||
GsonBuilder gsonbuilder = new GsonBuilder();
|
||||
|
||||
gsonbuilder.disableHtmlEscaping();
|
||||
|
@ -1158,7 +1158,7 @@ index 4d664338f3d5570fd0133ace6b297d70045b34a7..984105c226f16746b43bb2d2932e0b87
|
|||
gsonbuilder.registerTypeHierarchyAdapter(Component.class, new Component.Serializer());
|
||||
gsonbuilder.registerTypeHierarchyAdapter(Style.class, new Style.Serializer());
|
||||
gsonbuilder.registerTypeAdapterFactory(new LowerCaseEnumTypeAdapterFactory());
|
||||
@@ -320,6 +322,7 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
||||
@@ -375,6 +377,7 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
||||
}
|
||||
|
||||
public JsonElement serialize(Component ichatbasecomponent, Type type, JsonSerializationContext jsonserializationcontext) {
|
||||
|
@ -1166,30 +1166,43 @@ index 4d664338f3d5570fd0133ace6b297d70045b34a7..984105c226f16746b43bb2d2932e0b87
|
|||
JsonObject jsonobject = new JsonObject();
|
||||
|
||||
if (!ichatbasecomponent.getStyle().isEmpty()) {
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java
|
||||
index 743db7bfc58ff9e90a1b6d20d1bf64ecb6906327..f4f52e43852d2b0b56770c3f747a655a3a6dd683 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java
|
||||
@@ -10,6 +10,7 @@ import net.minecraft.network.protocol.Packet;
|
||||
public class ClientboundChatPacket implements Packet<ClientGamePacketListener> {
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerChatPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerChatPacket.java
|
||||
index fc2d39d93f88d71af503c20c497be7385ec312eb..4a3279f9053a3baaa3dd61c53e1bfbbf72f2dadb 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerChatPacket.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerChatPacket.java
|
||||
@@ -14,9 +14,15 @@ import net.minecraft.network.chat.PlayerChatMessage;
|
||||
import net.minecraft.network.protocol.Packet;
|
||||
import net.minecraft.util.Crypt;
|
||||
|
||||
private final Component message;
|
||||
+ public net.kyori.adventure.text.Component adventure$message; // Paper
|
||||
public net.md_5.bungee.api.chat.BaseComponent[] components; // Spigot
|
||||
private final ChatType type;
|
||||
private final UUID sender;
|
||||
@@ -28,6 +29,11 @@ public class ClientboundChatPacket implements Packet<ClientGamePacketListener> {
|
||||
-public record ClientboundPlayerChatPacket(Component signedContent, Optional<Component> unsignedContent, int typeId, ChatSender sender, Instant timeStamp, Crypt.SaltSignaturePair saltSignature) implements Packet<ClientGamePacketListener> {
|
||||
+// Paper start
|
||||
+public record ClientboundPlayerChatPacket(@org.jetbrains.annotations.Nullable net.kyori.adventure.text.Component adventure$message, Component signedContent, Optional<Component> unsignedContent, int typeId, ChatSender sender, Instant timeStamp, Crypt.SaltSignaturePair saltSignature) implements Packet<ClientGamePacketListener> {
|
||||
private static final Duration MESSAGE_EXPIRES_AFTER = ServerboundChatPacket.MESSAGE_EXPIRES_AFTER.plus(Duration.ofMinutes(2L));
|
||||
|
||||
+ public ClientboundPlayerChatPacket(Component signedContent, Optional<Component> unsignedContent, int typeId, ChatSender sender, Instant timeStamp, Crypt.SaltSignaturePair saltSignature) {
|
||||
+ this(null, signedContent, unsignedContent, typeId, sender, timeStamp, saltSignature);
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
public ClientboundPlayerChatPacket(FriendlyByteBuf buf) {
|
||||
this(buf.readComponent(), buf.readOptional(FriendlyByteBuf::readComponent), buf.readVarInt(), new ChatSender(buf), buf.readInstant(), new Crypt.SaltSignaturePair(buf));
|
||||
}
|
||||
@@ -24,7 +30,15 @@ public record ClientboundPlayerChatPacket(Component signedContent, Optional<Comp
|
||||
@Override
|
||||
public void write(FriendlyByteBuf buf) {
|
||||
buf.writeComponent(this.signedContent);
|
||||
+ // Paper start
|
||||
+ //TODO Proper API and writing signed contents
|
||||
+ if (this.adventure$message != null) {
|
||||
+ buf.writeBoolean(true);
|
||||
+ buf.writeComponent(this.adventure$message);
|
||||
+ } else
|
||||
+ } else {
|
||||
buf.writeOptional(this.unsignedContent, FriendlyByteBuf::writeComponent);
|
||||
+ }
|
||||
+ // Paper end
|
||||
// Spigot start
|
||||
if (this.components != null) {
|
||||
buf.writeUtf(net.md_5.bungee.chat.ComponentSerializer.toString(components));
|
||||
buf.writeVarInt(this.typeId);
|
||||
this.sender.write(buf);
|
||||
buf.writeInstant(this.timeStamp);
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetActionBarTextPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetActionBarTextPacket.java
|
||||
index 02183c810f9968621b9b20c1f7b54258b620c507..32ef3edebe94a2014168b7e438752a80b2687e5f 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetActionBarTextPacket.java
|
||||
|
@ -1262,6 +1275,52 @@ index 1fb62779527a228f748b49a4d2ddfc57ccb80cf8..bd808eb312ade7122973a47f4b965058
|
|||
buf.writeComponent(this.text);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSystemChatPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSystemChatPacket.java
|
||||
index 32b391d7c4c21813db204957286a11970267a3bd..75b5f37c54a4de7f4235e2e5246aeda8a605ef45 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSystemChatPacket.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSystemChatPacket.java
|
||||
@@ -8,17 +8,23 @@ import net.minecraft.network.chat.ChatType;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.protocol.Packet;
|
||||
|
||||
+// Paper start
|
||||
// Spigot start
|
||||
-public record ClientboundSystemChatPacket(String content, int typeId) implements Packet<ClientGamePacketListener> {
|
||||
+public record ClientboundSystemChatPacket(@org.jetbrains.annotations.Nullable net.kyori.adventure.text.Component adventure$message, String content, int typeId) implements Packet<ClientGamePacketListener> {
|
||||
+
|
||||
+ public ClientboundSystemChatPacket(String content, int typeId) {
|
||||
+ this(null, content, typeId);
|
||||
+ }
|
||||
|
||||
public ClientboundSystemChatPacket(Component content, int typeId) {
|
||||
- this(Component.Serializer.toJson(content), typeId);
|
||||
+ this(null, Component.Serializer.toJson(content), typeId);
|
||||
}
|
||||
|
||||
public ClientboundSystemChatPacket(net.md_5.bungee.api.chat.BaseComponent[] content, int typeId) {
|
||||
- this(net.md_5.bungee.chat.ComponentSerializer.toString(content), typeId);
|
||||
+ this(null, net.md_5.bungee.chat.ComponentSerializer.toString(content), typeId);
|
||||
}
|
||||
// Spigot end
|
||||
+ // Paper end
|
||||
|
||||
public ClientboundSystemChatPacket(FriendlyByteBuf buf) {
|
||||
this(buf.readComponent(), buf.readVarInt());
|
||||
@@ -26,7 +32,13 @@ public record ClientboundSystemChatPacket(String content, int typeId) implements
|
||||
|
||||
@Override
|
||||
public void write(FriendlyByteBuf buf) {
|
||||
- buf.writeUtf(this.content, 262144); // Spigot
|
||||
+ // Paper start
|
||||
+ if (adventure$message != null) {
|
||||
+ buf.writeComponent(this.adventure$message);
|
||||
+ } else {
|
||||
+ buf.writeUtf(this.content, 262144); // Spigot
|
||||
+ }
|
||||
+ // Paper end
|
||||
buf.writeVarInt(this.typeId);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundTabListPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundTabListPacket.java
|
||||
index 762a9392ffac3042356709dddd15bb3516048bed..3544e2dc2522e9d6305d727d56e73490015662c2 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundTabListPacket.java
|
||||
|
@ -1292,10 +1351,10 @@ index 762a9392ffac3042356709dddd15bb3516048bed..3544e2dc2522e9d6305d727d56e73490
|
|||
buf.writeComponent(this.footer);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 3431a70a07c08fdc20c7a8d667e6275f212b549e..d4d444b5864073fe86bfc7b5a68344b5aae8c05f 100644
|
||||
index 56996af65ef7478adb90d3b2f4cd3351fc49200b..7002d5f5700570e32ebf0b63e340d87d58357162 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -145,6 +145,7 @@ import net.minecraft.world.scores.Score;
|
||||
@@ -152,6 +152,7 @@ import net.minecraft.world.scores.Score;
|
||||
import net.minecraft.world.scores.Scoreboard;
|
||||
import net.minecraft.world.scores.Team;
|
||||
import net.minecraft.world.scores.criteria.ObjectiveCriteria;
|
||||
|
@ -1303,7 +1362,7 @@ index 3431a70a07c08fdc20c7a8d667e6275f212b549e..d4d444b5864073fe86bfc7b5a68344b5
|
|||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.WeatherType;
|
||||
@@ -221,6 +222,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -228,6 +229,7 @@ public class ServerPlayer extends Player {
|
||||
|
||||
// CraftBukkit start
|
||||
public String displayName;
|
||||
|
@ -1311,7 +1370,7 @@ index 3431a70a07c08fdc20c7a8d667e6275f212b549e..d4d444b5864073fe86bfc7b5a68344b5
|
|||
public Component listName;
|
||||
public org.bukkit.Location compassTarget;
|
||||
public int newExp = 0;
|
||||
@@ -303,6 +305,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -310,6 +312,7 @@ public class ServerPlayer extends Player {
|
||||
|
||||
// CraftBukkit start
|
||||
this.displayName = this.getScoreboardName();
|
||||
|
@ -1319,7 +1378,7 @@ index 3431a70a07c08fdc20c7a8d667e6275f212b549e..d4d444b5864073fe86bfc7b5a68344b5
|
|||
this.bukkitPickUpLoot = true;
|
||||
this.maxHealthCache = this.getMaxHealth();
|
||||
}
|
||||
@@ -778,22 +781,17 @@ public class ServerPlayer extends Player {
|
||||
@@ -786,22 +789,17 @@ public class ServerPlayer extends Player {
|
||||
|
||||
String deathmessage = defaultMessage.getString();
|
||||
this.keepLevel = keepInventory; // SPIGOT-2222: pre-set keepLevel
|
||||
|
@ -1346,7 +1405,7 @@ index 3431a70a07c08fdc20c7a8d667e6275f212b549e..d4d444b5864073fe86bfc7b5a68344b5
|
|||
|
||||
this.connection.send(new ClientboundPlayerCombatKillPacket(this.getCombatTracker(), ichatbasecomponent), (future) -> {
|
||||
if (!future.isSuccess()) {
|
||||
@@ -1735,6 +1733,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -1757,6 +1755,7 @@ public class ServerPlayer extends Player {
|
||||
}
|
||||
|
||||
public String locale = "en_us"; // CraftBukkit - add, lowercase
|
||||
|
@ -1354,7 +1413,7 @@ index 3431a70a07c08fdc20c7a8d667e6275f212b549e..d4d444b5864073fe86bfc7b5a68344b5
|
|||
public void updateOptions(ServerboundClientInformationPacket packet) {
|
||||
// CraftBukkit start
|
||||
if (getMainArm() != packet.mainHand()) {
|
||||
@@ -1746,6 +1745,10 @@ public class ServerPlayer extends Player {
|
||||
@@ -1768,6 +1767,10 @@ public class ServerPlayer extends Player {
|
||||
this.server.server.getPluginManager().callEvent(event);
|
||||
}
|
||||
this.locale = packet.language;
|
||||
|
@ -1366,10 +1425,10 @@ index 3431a70a07c08fdc20c7a8d667e6275f212b549e..d4d444b5864073fe86bfc7b5a68344b5
|
|||
// CraftBukkit end
|
||||
this.chatVisibility = packet.chatVisibility();
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 3d9a2d4ff540f02163edd023ff86815fda5a35b8..9dd29a669a10735819d3be03e4693850de58bb28 100644
|
||||
index 2cbe0230173ad391fe70b0a31d8999927461b5e6..bf00219f3795c0e303960dae3123d1cc6f5b7837 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -155,6 +155,8 @@ import org.apache.commons.lang3.StringUtils;
|
||||
@@ -172,6 +172,8 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
// CraftBukkit start
|
||||
|
@ -1378,7 +1437,7 @@ index 3d9a2d4ff540f02163edd023ff86815fda5a35b8..9dd29a669a10735819d3be03e4693850
|
|||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import net.minecraft.world.entity.animal.Bucketable;
|
||||
@@ -384,21 +386,24 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@@ -412,21 +414,24 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
return this.server.isSingleplayerOwner(this.player.getGameProfile());
|
||||
}
|
||||
|
||||
|
@ -1411,7 +1470,7 @@ index 3d9a2d4ff540f02163edd023ff86815fda5a35b8..9dd29a669a10735819d3be03e4693850
|
|||
|
||||
if (this.cserver.getServer().isRunning()) {
|
||||
this.cserver.getPluginManager().callEvent(event);
|
||||
@@ -410,8 +415,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@@ -438,8 +443,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
}
|
||||
this.player.kickLeaveMessage = event.getLeaveMessage(); // CraftBukkit - SPIGOT-3034: Forward leave message to PlayerQuitEvent
|
||||
// Send the possibly modified leave message
|
||||
|
@ -1421,7 +1480,7 @@ index 3d9a2d4ff540f02163edd023ff86815fda5a35b8..9dd29a669a10735819d3be03e4693850
|
|||
// CraftBukkit end
|
||||
|
||||
this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), (future) -> {
|
||||
@@ -1686,9 +1690,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@@ -1719,9 +1723,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
*/
|
||||
|
||||
this.player.disconnect();
|
||||
|
@ -1436,7 +1495,7 @@ index 3d9a2d4ff540f02163edd023ff86815fda5a35b8..9dd29a669a10735819d3be03e4693850
|
|||
}
|
||||
// CraftBukkit end
|
||||
this.player.getTextFilter().leave();
|
||||
@@ -1870,7 +1876,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@@ -1946,7 +1952,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
this.handleCommand(s);
|
||||
} else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) {
|
||||
// Do nothing, this is coming from a plugin
|
||||
|
@ -1450,7 +1509,7 @@ index 3d9a2d4ff540f02163edd023ff86815fda5a35b8..9dd29a669a10735819d3be03e4693850
|
|||
Player player = this.getCraftPlayer();
|
||||
AsyncPlayerChatEvent event = new AsyncPlayerChatEvent(async, player, s, new LazyPlayerSet(this.server));
|
||||
this.cserver.getPluginManager().callEvent(event);
|
||||
@@ -2669,30 +2680,30 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@@ -2860,30 +2871,30 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1464,15 +1523,14 @@ index 3d9a2d4ff540f02163edd023ff86815fda5a35b8..9dd29a669a10735819d3be03e4693850
|
|||
+ List<net.kyori.adventure.text.Component> lines = new java.util.ArrayList<>();
|
||||
|
||||
for (int i = 0; i < signText.size(); ++i) {
|
||||
- TextFilter.FilteredText itextfilter_a = (TextFilter.FilteredText) signText.get(i);
|
||||
+ TextFilter.FilteredText currentLine = signText.get(i);
|
||||
FilteredText<Component> filteredtext = (signText.get(i)).map(Component::literal); // CraftBukkit - decompile error
|
||||
|
||||
if (this.player.isTextFilteringEnabled()) {
|
||||
- lines[i] = ChatFormatting.stripFormatting(new TextComponent(ChatFormatting.stripFormatting(itextfilter_a.getFiltered())).getString());
|
||||
+ lines.add(net.kyori.adventure.text.Component.text(currentLine.getFiltered()));
|
||||
- lines[i] = ChatFormatting.stripFormatting(filteredtext.filteredOrElse(CommonComponents.EMPTY).getString());
|
||||
+ lines.add(net.kyori.adventure.text.Component.text(filteredtext.filteredOrElse(CommonComponents.EMPTY).getString())); // Paper - adventure
|
||||
} else {
|
||||
- lines[i] = ChatFormatting.stripFormatting(new TextComponent(ChatFormatting.stripFormatting(itextfilter_a.getRaw())).getString());
|
||||
+ lines.add(net.kyori.adventure.text.Component.text(currentLine.getRaw()));
|
||||
- lines[i] = ChatFormatting.stripFormatting(filteredtext.raw().getString());
|
||||
+ lines.add(net.kyori.adventure.text.Component.text(filteredtext.raw().getString())); // Paper - adventure
|
||||
}
|
||||
}
|
||||
SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.player.getBukkitEntity(), lines);
|
||||
|
@ -1490,10 +1548,10 @@ index 3d9a2d4ff540f02163edd023ff86815fda5a35b8..9dd29a669a10735819d3be03e4693850
|
|||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
index 2b9b60c0010069916dbecd22efdb9cec71180363..627931ec09bfb1a84f0659981491cf3b6425aa32 100644
|
||||
index fc2910ee691da96591811e4c97987ebd2cb93ac3..ff8773f3671970bd759303f7a4bbc17d4df5a1de 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -323,7 +323,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
|
||||
@@ -377,7 +377,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
|
||||
if (PlayerPreLoginEvent.getHandlerList().getRegisteredListeners().length != 0) {
|
||||
final PlayerPreLoginEvent event = new PlayerPreLoginEvent(playerName, address, uniqueId);
|
||||
if (asyncEvent.getResult() != PlayerPreLoginEvent.Result.ALLOWED) {
|
||||
|
@ -1502,7 +1560,7 @@ index 2b9b60c0010069916dbecd22efdb9cec71180363..627931ec09bfb1a84f0659981491cf3b
|
|||
}
|
||||
Waitable<PlayerPreLoginEvent.Result> waitable = new Waitable<PlayerPreLoginEvent.Result>() {
|
||||
@Override
|
||||
@@ -334,12 +334,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
|
||||
@@ -388,12 +388,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
|
||||
|
||||
ServerLoginPacketListenerImpl.this.server.processQueue.add(waitable);
|
||||
if (waitable.get() != PlayerPreLoginEvent.Result.ALLOWED) {
|
||||
|
@ -1518,10 +1576,10 @@ index 2b9b60c0010069916dbecd22efdb9cec71180363..627931ec09bfb1a84f0659981491cf3b
|
|||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
||||
index c9a8d64ef23def0ad8e986a97c34331b8d54c205..2b24a41587fbe1fba70a0ab42d3dc33358f2ba2e 100644
|
||||
index 8670f3fab7ec2a80d69e5dd3f945fc15aaa1a36f..5d368e34c90fc5191d9ed2352f7aa44c4a299eed 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
||||
@@ -55,7 +55,7 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
|
||||
@@ -54,7 +54,7 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
|
||||
CraftIconCache icon = server.server.getServerIcon();
|
||||
|
||||
ServerListPingEvent() {
|
||||
|
@ -1531,7 +1589,7 @@ index c9a8d64ef23def0ad8e986a97c34331b8d54c205..2b24a41587fbe1fba70a0ab42d3dc333
|
|||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 60b4044e3d914ff83a4f37499e278fbcbc65e5c1..fbe28ea0fd3bf85b564cf6156e1a2a7efa75822d 100644
|
||||
index 2fc5519020af0f18e93bf11cc0d33f65f1b23b55..821b9c0ba003163195a461dd0bce1fa9ffd0a146 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -8,6 +8,7 @@ import com.mojang.logging.LogUtils;
|
||||
|
@ -1542,7 +1600,7 @@ index 60b4044e3d914ff83a4f37499e278fbcbc65e5c1..fbe28ea0fd3bf85b564cf6156e1a2a7e
|
|||
import java.io.File;
|
||||
import java.net.SocketAddress;
|
||||
import java.nio.file.Path;
|
||||
@@ -90,6 +91,7 @@ import net.minecraft.world.scores.Team;
|
||||
@@ -100,6 +101,7 @@ import net.minecraft.world.scores.Team;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
// CraftBukkit start
|
||||
|
@ -1550,21 +1608,21 @@ index 60b4044e3d914ff83a4f37499e278fbcbc65e5c1..fbe28ea0fd3bf85b564cf6156e1a2a7e
|
|||
import com.google.common.base.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
import net.minecraft.server.dedicated.DedicatedServer;
|
||||
@@ -258,7 +260,7 @@ public abstract class PlayerList {
|
||||
@@ -262,7 +264,7 @@ public abstract class PlayerList {
|
||||
}
|
||||
// CraftBukkit start
|
||||
chatmessage.withStyle(ChatFormatting.YELLOW);
|
||||
- String joinMessage = CraftChatMessage.fromComponent(chatmessage);
|
||||
+ Component joinMessage = chatmessage; // Paper - Adventure
|
||||
ichatmutablecomponent.withStyle(ChatFormatting.YELLOW);
|
||||
- String joinMessage = CraftChatMessage.fromComponent(ichatmutablecomponent);
|
||||
+ Component joinMessage = ichatmutablecomponent; // Paper - Adventure
|
||||
|
||||
playerconnection.teleport(player.getX(), player.getY(), player.getZ(), player.getYRot(), player.getXRot());
|
||||
this.players.add(player);
|
||||
@@ -272,19 +274,18 @@ public abstract class PlayerList {
|
||||
@@ -276,19 +278,18 @@ public abstract class PlayerList {
|
||||
// Ensure that player inventory is populated with its viewer
|
||||
player.containerMenu.transferTo(player.containerMenu, bukkitPlayer);
|
||||
|
||||
- PlayerJoinEvent playerJoinEvent = new PlayerJoinEvent(bukkitPlayer, joinMessage);
|
||||
+ PlayerJoinEvent playerJoinEvent = new PlayerJoinEvent(bukkitPlayer, PaperAdventure.asAdventure(chatmessage)); // Paper - Adventure
|
||||
+ PlayerJoinEvent playerJoinEvent = new PlayerJoinEvent(bukkitPlayer, PaperAdventure.asAdventure(ichatmutablecomponent)); // Paper - Adventure
|
||||
this.cserver.getPluginManager().callEvent(playerJoinEvent);
|
||||
|
||||
if (!player.connection.connection.isConnected()) {
|
||||
|
@ -1576,15 +1634,15 @@ index 60b4044e3d914ff83a4f37499e278fbcbc65e5c1..fbe28ea0fd3bf85b564cf6156e1a2a7e
|
|||
|
||||
- if (joinMessage != null && joinMessage.length() > 0) {
|
||||
- for (Component line : org.bukkit.craftbukkit.util.CraftChatMessage.fromString(joinMessage)) {
|
||||
- this.server.getPlayerList().broadcastAll(new ClientboundChatPacket(line, ChatType.SYSTEM, Util.NIL_UUID));
|
||||
- this.server.getPlayerList().broadcastSystemMessage(line, ChatType.SYSTEM);
|
||||
- }
|
||||
+ if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure
|
||||
+ joinMessage = PaperAdventure.asVanilla(jm); // Paper - Adventure
|
||||
+ this.server.getPlayerList().broadcastAll(new ClientboundChatPacket(joinMessage, ChatType.SYSTEM, Util.NIL_UUID)); // Paper - Adventure
|
||||
+ this.server.getPlayerList().broadcastSystemMessage(joinMessage, ChatType.SYSTEM); // Paper - Adventure
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -481,7 +482,7 @@ public abstract class PlayerList {
|
||||
@@ -485,7 +486,7 @@ public abstract class PlayerList {
|
||||
|
||||
}
|
||||
|
||||
|
@ -1593,7 +1651,7 @@ index 60b4044e3d914ff83a4f37499e278fbcbc65e5c1..fbe28ea0fd3bf85b564cf6156e1a2a7e
|
|||
ServerLevel worldserver = entityplayer.getLevel();
|
||||
|
||||
entityplayer.awardStat(Stats.LEAVE_GAME);
|
||||
@@ -492,7 +493,7 @@ public abstract class PlayerList {
|
||||
@@ -496,7 +497,7 @@ public abstract class PlayerList {
|
||||
entityplayer.closeContainer();
|
||||
}
|
||||
|
||||
|
@ -1602,7 +1660,7 @@ index 60b4044e3d914ff83a4f37499e278fbcbc65e5c1..fbe28ea0fd3bf85b564cf6156e1a2a7e
|
|||
this.cserver.getPluginManager().callEvent(playerQuitEvent);
|
||||
entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage());
|
||||
|
||||
@@ -545,7 +546,7 @@ public abstract class PlayerList {
|
||||
@@ -549,7 +550,7 @@ public abstract class PlayerList {
|
||||
this.cserver.getScoreboardManager().removePlayer(entityplayer.getBukkitEntity());
|
||||
// CraftBukkit end
|
||||
|
||||
|
@ -1611,27 +1669,27 @@ index 60b4044e3d914ff83a4f37499e278fbcbc65e5c1..fbe28ea0fd3bf85b564cf6156e1a2a7e
|
|||
}
|
||||
|
||||
// CraftBukkit start - Whole method, SocketAddress to LoginListener, added hostname to signature, return EntityPlayer
|
||||
@@ -591,10 +592,10 @@ public abstract class PlayerList {
|
||||
@@ -595,10 +596,10 @@ public abstract class PlayerList {
|
||||
}
|
||||
|
||||
// return chatmessage;
|
||||
- event.disallow(PlayerLoginEvent.Result.KICK_BANNED, CraftChatMessage.fromComponent(chatmessage));
|
||||
+ event.disallow(PlayerLoginEvent.Result.KICK_BANNED, PaperAdventure.asAdventure(chatmessage)); // Paper - Adventure
|
||||
- event.disallow(PlayerLoginEvent.Result.KICK_BANNED, CraftChatMessage.fromComponent(ichatmutablecomponent));
|
||||
+ event.disallow(PlayerLoginEvent.Result.KICK_BANNED, PaperAdventure.asAdventure(ichatmutablecomponent)); // Paper - Adventure
|
||||
} else if (!this.isWhiteListed(gameprofile)) {
|
||||
chatmessage = new TranslatableComponent("multiplayer.disconnect.not_whitelisted");
|
||||
ichatmutablecomponent = Component.translatable("multiplayer.disconnect.not_whitelisted");
|
||||
- event.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, org.spigotmc.SpigotConfig.whitelistMessage); // Spigot
|
||||
+ event.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(org.spigotmc.SpigotConfig.whitelistMessage)); // Spigot // Paper - Adventure
|
||||
} else if (this.getIpBans().isBanned(socketaddress) && !this.getIpBans().get(socketaddress).hasExpired()) {
|
||||
IpBanListEntry ipbanentry = this.ipBans.get(socketaddress);
|
||||
|
||||
@@ -604,17 +605,17 @@ public abstract class PlayerList {
|
||||
@@ -608,17 +609,17 @@ public abstract class PlayerList {
|
||||
}
|
||||
|
||||
// return chatmessage;
|
||||
- event.disallow(PlayerLoginEvent.Result.KICK_BANNED, CraftChatMessage.fromComponent(chatmessage));
|
||||
+ event.disallow(PlayerLoginEvent.Result.KICK_BANNED, PaperAdventure.asAdventure(chatmessage)); // Paper - Adventure
|
||||
- event.disallow(PlayerLoginEvent.Result.KICK_BANNED, CraftChatMessage.fromComponent(ichatmutablecomponent));
|
||||
+ event.disallow(PlayerLoginEvent.Result.KICK_BANNED, PaperAdventure.asAdventure(ichatmutablecomponent)); // Paper - Adventure
|
||||
} else {
|
||||
// return this.players.size() >= this.maxPlayers && !this.canBypassPlayerLimit(gameprofile) ? new ChatMessage("multiplayer.disconnect.server_full") : null;
|
||||
// return this.players.size() >= this.maxPlayers && !this.canBypassPlayerLimit(gameprofile) ? IChatBaseComponent.translatable("multiplayer.disconnect.server_full") : null;
|
||||
if (this.players.size() >= this.maxPlayers && !this.canBypassPlayerLimit(gameprofile)) {
|
||||
- event.disallow(PlayerLoginEvent.Result.KICK_FULL, org.spigotmc.SpigotConfig.serverFullMessage); // Spigot
|
||||
+ event.disallow(PlayerLoginEvent.Result.KICK_FULL, net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(org.spigotmc.SpigotConfig.serverFullMessage)); // Spigot // Paper - Adventure
|
||||
|
@ -1645,7 +1703,7 @@ index 60b4044e3d914ff83a4f37499e278fbcbc65e5c1..fbe28ea0fd3bf85b564cf6156e1a2a7e
|
|||
return null;
|
||||
}
|
||||
return entity;
|
||||
@@ -1122,7 +1123,7 @@ public abstract class PlayerList {
|
||||
@@ -1126,7 +1127,7 @@ public abstract class PlayerList {
|
||||
public void removeAll() {
|
||||
// CraftBukkit start - disconnect safely
|
||||
for (ServerPlayer player : this.players) {
|
||||
|
@ -1764,10 +1822,10 @@ index 595b56b2ab9a813ba71399d306117294fa90dc65..3527d40102d512d0e276edc969ea3c18
|
|||
}
|
||||
collection = icons;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 66e8fea6bd10af2e19a4f49c556e66a63e6205b6..81e78644417764cee33f81cdb116a91fb1d8ccf3 100644
|
||||
index daf5dc59a1883570569798630c4991e676e34c1c..5408ba255ee04b75e2f4977fc7aa73866945037c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -586,8 +586,10 @@ public final class CraftServer implements Server {
|
||||
@@ -581,8 +581,10 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1778,7 +1836,7 @@ index 66e8fea6bd10af2e19a4f49c556e66a63e6205b6..81e78644417764cee33f81cdb116a91f
|
|||
}
|
||||
|
||||
@Override
|
||||
@@ -1421,7 +1423,15 @@ public final class CraftServer implements Server {
|
||||
@@ -1404,7 +1406,15 @@ public final class CraftServer implements Server {
|
||||
return this.configuration.getInt("settings.spawn-radius", -1);
|
||||
}
|
||||
|
||||
|
@ -1794,7 +1852,7 @@ index 66e8fea6bd10af2e19a4f49c556e66a63e6205b6..81e78644417764cee33f81cdb116a91f
|
|||
public String getShutdownMessage() {
|
||||
return this.configuration.getString("settings.shutdown-message");
|
||||
}
|
||||
@@ -1579,7 +1589,20 @@ public final class CraftServer implements Server {
|
||||
@@ -1562,7 +1572,20 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1815,7 +1873,7 @@ index 66e8fea6bd10af2e19a4f49c556e66a63e6205b6..81e78644417764cee33f81cdb116a91f
|
|||
Set<CommandSender> recipients = new HashSet<>();
|
||||
for (Permissible permissible : this.getPluginManager().getPermissionSubscriptions(permission)) {
|
||||
if (permissible instanceof CommandSender && permissible.hasPermission(permission)) {
|
||||
@@ -1587,14 +1610,14 @@ public final class CraftServer implements Server {
|
||||
@@ -1570,14 +1593,14 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1832,7 +1890,7 @@ index 66e8fea6bd10af2e19a4f49c556e66a63e6205b6..81e78644417764cee33f81cdb116a91f
|
|||
|
||||
for (CommandSender recipient : recipients) {
|
||||
recipient.sendMessage(message);
|
||||
@@ -1845,6 +1868,14 @@ public final class CraftServer implements Server {
|
||||
@@ -1828,6 +1851,14 @@ public final class CraftServer implements Server {
|
||||
return CraftInventoryCreator.INSTANCE.createInventory(owner, type);
|
||||
}
|
||||
|
||||
|
@ -1847,7 +1905,7 @@ index 66e8fea6bd10af2e19a4f49c556e66a63e6205b6..81e78644417764cee33f81cdb116a91f
|
|||
@Override
|
||||
public Inventory createInventory(InventoryHolder owner, InventoryType type, String title) {
|
||||
Validate.isTrue(type.isCreatable(), "Cannot open an inventory of type ", type);
|
||||
@@ -1857,13 +1888,28 @@ public final class CraftServer implements Server {
|
||||
@@ -1840,13 +1871,28 @@ public final class CraftServer implements Server {
|
||||
return CraftInventoryCreator.INSTANCE.createInventory(owner, size);
|
||||
}
|
||||
|
||||
|
@ -1876,7 +1934,7 @@ index 66e8fea6bd10af2e19a4f49c556e66a63e6205b6..81e78644417764cee33f81cdb116a91f
|
|||
public Merchant createMerchant(String title) {
|
||||
return new CraftMerchantCustom(title == null ? InventoryType.MERCHANT.getDefaultTitle() : title);
|
||||
}
|
||||
@@ -1923,6 +1969,12 @@ public final class CraftServer implements Server {
|
||||
@@ -1906,6 +1952,12 @@ public final class CraftServer implements Server {
|
||||
return Thread.currentThread().equals(console.serverThread) || this.console.hasStopped() || !org.spigotmc.AsyncCatcher.enabled; // All bets are off if we have shut down (e.g. due to watchdog)
|
||||
}
|
||||
|
||||
|
@ -1889,7 +1947,7 @@ index 66e8fea6bd10af2e19a4f49c556e66a63e6205b6..81e78644417764cee33f81cdb116a91f
|
|||
@Override
|
||||
public String getMotd() {
|
||||
return this.console.getMotd();
|
||||
@@ -2370,5 +2422,15 @@ public final class CraftServer implements Server {
|
||||
@@ -2353,5 +2405,15 @@ public final class CraftServer implements Server {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -1906,10 +1964,10 @@ index 66e8fea6bd10af2e19a4f49c556e66a63e6205b6..81e78644417764cee33f81cdb116a91f
|
|||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index b8b47416b66ec2272ce9ffdc06b0a1dd91b4c05a..5476dc1e80093d7684bc238bae102cbb691cec4f 100644
|
||||
index 40421cc8ef25f1bef32a0a5d2f0f25165efe230a..1357bc97801f892e59fc8e89c3cc2d697894ccfb 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -143,6 +143,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -144,6 +144,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
private final BlockMetadataStore blockMetadata = new BlockMetadataStore(this);
|
||||
private final Object2IntOpenHashMap<SpawnCategory> spawnCategoryLimit = new Object2IntOpenHashMap<>();
|
||||
private final CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftWorld.DATA_TYPE_REGISTRY);
|
||||
|
@ -1917,7 +1975,7 @@ index b8b47416b66ec2272ce9ffdc06b0a1dd91b4c05a..5476dc1e80093d7684bc238bae102cbb
|
|||
|
||||
private static final Random rand = new Random();
|
||||
|
||||
@@ -1863,4 +1864,18 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -1864,4 +1865,18 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
return this.spigot;
|
||||
}
|
||||
// Spigot end
|
||||
|
@ -1937,7 +1995,7 @@ index b8b47416b66ec2272ce9ffdc06b0a1dd91b4c05a..5476dc1e80093d7684bc238bae102cbb
|
|||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index fae37b7b353cb7b0f8d4a79407fcc219a3c45b64..aff3116c77277dcb4d3825d33f40a0b17258a0ba 100644
|
||||
index c694c6dfed0b3aa098b1822676e39bd3eb04b45a..0d427758182ebe01d612d5140e4a0d519a96d8c0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -19,6 +19,12 @@ public class Main {
|
||||
|
@ -2047,10 +2105,10 @@ index 0beb96dc896f63003e1b1ae458b73902bdbe648a..102eb86bad3000f258775ac06ecd1a6d
|
|||
public String getCustomName() {
|
||||
EnchantmentTableBlockEntity enchant = this.getSnapshot();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
|
||||
index 9e68893b189ad05e4d2a5e8788e93e10670ac824..26f21754b5ec3d1cbd455c4d9d04af299fc10b1b 100644
|
||||
index 3f5292deeeddb8a6a5df57aac01f48ba11be6d7c..541f943d307f5307460ea049294fd98d53054d52 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
|
||||
@@ -14,34 +14,60 @@ import org.bukkit.entity.Player;
|
||||
@@ -13,34 +13,60 @@ import org.bukkit.entity.Player;
|
||||
public class CraftSign extends CraftBlockEntityState<SignBlockEntity> implements Sign {
|
||||
|
||||
// Lazily initialized only if requested:
|
||||
|
@ -2124,7 +2182,7 @@ index 9e68893b189ad05e4d2a5e8788e93e10670ac824..26f21754b5ec3d1cbd455c4d9d04af29
|
|||
}
|
||||
|
||||
@Override
|
||||
@@ -79,13 +105,16 @@ public class CraftSign extends CraftBlockEntityState<SignBlockEntity> implements
|
||||
@@ -78,13 +104,16 @@ public class CraftSign extends CraftBlockEntityState<SignBlockEntity> implements
|
||||
super.applyTo(sign);
|
||||
|
||||
if (this.lines != null) {
|
||||
|
@ -2145,7 +2203,7 @@ index 9e68893b189ad05e4d2a5e8788e93e10670ac824..26f21754b5ec3d1cbd455c4d9d04af29
|
|||
}
|
||||
}
|
||||
|
||||
@@ -100,6 +129,20 @@ public class CraftSign extends CraftBlockEntityState<SignBlockEntity> implements
|
||||
@@ -99,6 +128,20 @@ public class CraftSign extends CraftBlockEntityState<SignBlockEntity> implements
|
||||
((CraftPlayer) player).getHandle().openTextEdit(handle);
|
||||
}
|
||||
|
||||
|
@ -2167,10 +2225,10 @@ index 9e68893b189ad05e4d2a5e8788e93e10670ac824..26f21754b5ec3d1cbd455c4d9d04af29
|
|||
Component[] components = new Component[4];
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java
|
||||
index 83efca7144b4ce9cf7bd6bbbbf9c4426d2472315..bf4c5c83c3c6d710c9c40257087a2c744a7d00c6 100644
|
||||
index 3de88112bdb08d6bd0d28f20582c4090bfd8dbfe..11164a28018be3ba46f898e57a1eefbeb0360426 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java
|
||||
@@ -46,6 +46,13 @@ public class CraftBlockCommandSender extends ServerCommandSender implements Bloc
|
||||
@@ -45,6 +45,13 @@ public class CraftBlockCommandSender extends ServerCommandSender implements Bloc
|
||||
return this.block.getTextName();
|
||||
}
|
||||
|
||||
|
@ -2215,10 +2273,10 @@ index f3cb4102ab223f379f60dac317df7da1fab812a8..324e6d1a4fadd3e557e4ba05f04e6a58
|
|||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/command/CraftRemoteConsoleCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/CraftRemoteConsoleCommandSender.java
|
||||
index 02a8c522a25f1c3c8eb0245560757772e627d31e..07f7effaa46afdd8766e3e6bfd8cb923e55f68cf 100644
|
||||
index 03027fe2b7ffe4c7ce7f1bb4f56051a4743c7f01..a6612cc0ea87aeb8e87521ff7b5fe58c7b06b9ef 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/command/CraftRemoteConsoleCommandSender.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/command/CraftRemoteConsoleCommandSender.java
|
||||
@@ -30,6 +30,13 @@ public class CraftRemoteConsoleCommandSender extends ServerCommandSender impleme
|
||||
@@ -29,6 +29,13 @@ public class CraftRemoteConsoleCommandSender extends ServerCommandSender impleme
|
||||
return "Rcon";
|
||||
}
|
||||
|
||||
|
@ -2282,10 +2340,10 @@ index 8107ed0d248ff2a1cf8e556b7610a68f6c197691..eaff8df6c8c12c64e005a68a02e2e35e
|
|||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java
|
||||
index cf69a45f038c2b8336010f5fe277313fd0513b5b..eb99e0c2462a2d1ab4508a5c3f1580b6e31d7465 100644
|
||||
index b4c90f8f55afcf66cff97d11ab5d69d3a692633e..7d186c7595dbcd109cee2cc16d70d8302b4d6b8f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java
|
||||
@@ -187,6 +187,12 @@ public class CraftEnchantment extends Enchantment {
|
||||
@@ -189,6 +189,12 @@ public class CraftEnchantment extends Enchantment {
|
||||
CraftEnchantment ench = (CraftEnchantment) other;
|
||||
return !this.target.isCompatibleWith(ench.target);
|
||||
}
|
||||
|
@ -2299,10 +2357,10 @@ index cf69a45f038c2b8336010f5fe277313fd0513b5b..eb99e0c2462a2d1ab4508a5c3f1580b6
|
|||
public net.minecraft.world.item.enchantment.Enchantment getHandle() {
|
||||
return this.target;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index a4907dee676e9e9cc2725a3312831198a0db7b10..4b7ed15279bbdd116d993f190094f80c888aed69 100644
|
||||
index 7fa6212fca01af9efd787f2c74af986fbeef4a77..b403022201b34118adddf817b19a8bbdb6229df4 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -191,6 +191,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
@@ -196,6 +196,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
protected Entity entity;
|
||||
private EntityDamageEvent lastDamageEvent;
|
||||
private final CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftEntity.DATA_TYPE_REGISTRY);
|
||||
|
@ -2310,7 +2368,7 @@ index a4907dee676e9e9cc2725a3312831198a0db7b10..4b7ed15279bbdd116d993f190094f80c
|
|||
|
||||
public CraftEntity(final CraftServer server, final Entity entity) {
|
||||
this.server = server;
|
||||
@@ -818,6 +819,32 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
@@ -830,6 +831,32 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
return this.getHandle().getVehicle().getBukkitEntity();
|
||||
}
|
||||
|
||||
|
@ -2343,7 +2401,7 @@ index a4907dee676e9e9cc2725a3312831198a0db7b10..4b7ed15279bbdd116d993f190094f80c
|
|||
@Override
|
||||
public void setCustomName(String name) {
|
||||
// sane limit for name length
|
||||
@@ -873,6 +900,17 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
@@ -885,6 +912,17 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
public String getName() {
|
||||
return CraftChatMessage.fromComponent(this.getHandle().getName());
|
||||
}
|
||||
|
@ -2414,10 +2472,10 @@ index 446fdca49a5a6999626a7ee3a1d5c168b15a09dd..f9863e138994f6c7a7975a852f106faa
|
|||
public boolean isOp() {
|
||||
return true;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 2577a135bb88adc9000ab67477846c6466d973e7..cd288194bee65fbf3b7fe8a5d36e09acb1931e57 100644
|
||||
index 765659b39d30e2e5c491c0808fe1808776ea767b..d8d634ea96a03a643f6743da8af23480824ced98 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -272,14 +272,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -270,14 +270,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
|
@ -2457,7 +2515,7 @@ index 2577a135bb88adc9000ab67477846c6466d973e7..cd288194bee65fbf3b7fe8a5d36e09ac
|
|||
@Override
|
||||
public String getPlayerListName() {
|
||||
return this.getHandle().listName == null ? getName() : CraftChatMessage.fromComponent(this.getHandle().listName);
|
||||
@@ -298,42 +323,42 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -296,42 +321,42 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2504,12 +2562,12 @@ index 2577a135bb88adc9000ab67477846c6466d973e7..cd288194bee65fbf3b7fe8a5d36e09ac
|
|||
private void updatePlayerListHeaderFooter() {
|
||||
if (this.getHandle().connection == null) return;
|
||||
|
||||
- ClientboundTabListPacket packet = new ClientboundTabListPacket((this.playerListHeader == null) ? new TextComponent("") : this.playerListHeader, (this.playerListFooter == null) ? new TextComponent("") : this.playerListFooter);
|
||||
+ ClientboundTabListPacket packet = new ClientboundTabListPacket((this.playerListHeader == null) ? new TextComponent("") : io.papermc.paper.adventure.PaperAdventure.asVanilla(this.playerListHeader), (this.playerListFooter == null) ? new TextComponent("") : io.papermc.paper.adventure.PaperAdventure.asVanilla(this.playerListFooter));
|
||||
- ClientboundTabListPacket packet = new ClientboundTabListPacket((this.playerListHeader == null) ? Component.empty() : this.playerListHeader, (this.playerListFooter == null) ? Component.empty() : this.playerListFooter);
|
||||
+ ClientboundTabListPacket packet = new ClientboundTabListPacket((this.playerListHeader == null) ? Component.empty() : io.papermc.paper.adventure.PaperAdventure.asVanilla(this.playerListHeader), (this.playerListFooter == null) ? Component.empty() : io.papermc.paper.adventure.PaperAdventure.asVanilla(this.playerListFooter)); // Paper - adventure
|
||||
this.getHandle().connection.send(packet);
|
||||
}
|
||||
|
||||
@@ -365,6 +390,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -363,6 +388,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
this.getHandle().connection.disconnect(message == null ? "" : message);
|
||||
}
|
||||
|
||||
|
@ -2533,7 +2591,7 @@ index 2577a135bb88adc9000ab67477846c6466d973e7..cd288194bee65fbf3b7fe8a5d36e09ac
|
|||
@Override
|
||||
public void setCompassTarget(Location loc) {
|
||||
if (this.getHandle().connection == null) return;
|
||||
@@ -620,6 +662,35 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -618,6 +660,35 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
this.getHandle().connection.send(packet);
|
||||
}
|
||||
|
||||
|
@ -2569,7 +2627,7 @@ index 2577a135bb88adc9000ab67477846c6466d973e7..cd288194bee65fbf3b7fe8a5d36e09ac
|
|||
@Override
|
||||
public void sendSignChange(Location loc, String[] lines) {
|
||||
this.sendSignChange(loc, lines, DyeColor.BLACK);
|
||||
@@ -647,14 +718,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -645,14 +716,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
|
||||
Component[] components = CraftSign.sanitizeLines(lines);
|
||||
|
@ -2587,7 +2645,7 @@ index 2577a135bb88adc9000ab67477846c6466d973e7..cd288194bee65fbf3b7fe8a5d36e09ac
|
|||
}
|
||||
|
||||
@Override
|
||||
@@ -1425,7 +1497,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1423,7 +1495,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
@Override
|
||||
public void setResourcePack(String url) {
|
||||
|
@ -2596,7 +2654,7 @@ index 2577a135bb88adc9000ab67477846c6466d973e7..cd288194bee65fbf3b7fe8a5d36e09ac
|
|||
}
|
||||
|
||||
@Override
|
||||
@@ -1440,7 +1512,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1438,7 +1510,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
@Override
|
||||
public void setResourcePack(String url, byte[] hash, boolean force) {
|
||||
|
@ -2605,7 +2663,7 @@ index 2577a135bb88adc9000ab67477846c6466d973e7..cd288194bee65fbf3b7fe8a5d36e09ac
|
|||
}
|
||||
|
||||
@Override
|
||||
@@ -1456,6 +1528,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1454,6 +1526,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2627,7 +2685,7 @@ index 2577a135bb88adc9000ab67477846c6466d973e7..cd288194bee65fbf3b7fe8a5d36e09ac
|
|||
public void addChannel(String channel) {
|
||||
Preconditions.checkState(this.channels.size() < 128, "Cannot register channel '%s'. Too many channels registered!", channel);
|
||||
channel = StandardMessenger.validateAndCorrectChannel(channel);
|
||||
@@ -1860,6 +1947,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1858,6 +1945,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
return (this.getHandle().clientViewDistance == null) ? Bukkit.getViewDistance() : this.getHandle().clientViewDistance;
|
||||
}
|
||||
|
||||
|
@ -2640,7 +2698,7 @@ index 2577a135bb88adc9000ab67477846c6466d973e7..cd288194bee65fbf3b7fe8a5d36e09ac
|
|||
@Override
|
||||
public int getPing() {
|
||||
return this.getHandle().latency;
|
||||
@@ -1905,6 +1998,194 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1903,6 +1996,194 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
return this.getHandle().allowsListing();
|
||||
}
|
||||
|
||||
|
@ -2861,7 +2919,7 @@ index e9349ebcaa86144eefdb053b9eacf7ff37f2c0ec..147368eb3003b6a081389ab81bd5016d
|
|||
return event;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
||||
index af9facfaa8bba614e37bd604ca0656a852d0325b..60fa587ce17e138d2baf8959c26e25ed1db17a4a 100644
|
||||
index e2711a189bcaffc0f79d903f0696d87b0de116fe..9531a11e63b4c5beeebabc45e4a40d5d39f05c7a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
||||
@@ -69,6 +69,13 @@ public class CraftContainer extends AbstractContainerMenu {
|
||||
|
@ -2983,10 +3041,10 @@ index 6a64fbb8b4937f39d5fdc2e2cbec26c83c74c486..7d6b5fdb00a5c1614849735634262a36
|
|||
public String getTitle() {
|
||||
return CraftChatMessage.fromComponent(this.container.getTitle());
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
index 2e1aff425b24e1cd2197305226119f9d84574154..f4e909ca1a8518d697acabca298c387b4bde7542 100644
|
||||
index c7503805bb2358996fb704288b8e4320aee6f425..a06f9775a43a245380edabde63e7999082e7958a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
@@ -368,4 +368,17 @@ public final class CraftItemFactory implements ItemFactory {
|
||||
@@ -374,4 +374,17 @@ public final class CraftItemFactory implements ItemFactory {
|
||||
public Material updateMaterial(ItemMeta meta, Material material) throws IllegalArgumentException {
|
||||
return ((CraftMetaItem) meta).updateMaterial(material);
|
||||
}
|
||||
|
@ -3005,10 +3063,10 @@ index 2e1aff425b24e1cd2197305226119f9d84574154..f4e909ca1a8518d697acabca298c387b
|
|||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantCustom.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantCustom.java
|
||||
index 059c84a4e50b043f2ac2a033d5d3cbf3cba3b3f9..552851cff3678d605428866999951fefd4375d7a 100644
|
||||
index 2669644228037f7447ddf98a48a58bbbf6129c37..eaec84147d3023c71865a6b2236879511e9f3685 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantCustom.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantCustom.java
|
||||
@@ -14,10 +14,17 @@ import org.apache.commons.lang.Validate;
|
||||
@@ -13,10 +13,17 @@ import org.apache.commons.lang.Validate;
|
||||
|
||||
public class CraftMerchantCustom extends CraftMerchant {
|
||||
|
||||
|
@ -3026,14 +3084,14 @@ index 059c84a4e50b043f2ac2a033d5d3cbf3cba3b3f9..552851cff3678d605428866999951fef
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
@@ -37,10 +44,17 @@ public class CraftMerchantCustom extends CraftMerchant {
|
||||
@@ -36,10 +43,17 @@ public class CraftMerchantCustom extends CraftMerchant {
|
||||
private Level tradingWorld;
|
||||
protected CraftMerchant craftMerchant;
|
||||
|
||||
+ @Deprecated // Paper - Adventure
|
||||
public MinecraftMerchant(String title) {
|
||||
Validate.notNull(title, "Title cannot be null");
|
||||
this.title = new TextComponent(title);
|
||||
this.title = Component.literal(title);
|
||||
}
|
||||
+ // Paper start
|
||||
+ public MinecraftMerchant(net.kyori.adventure.text.Component title) {
|
||||
|
@ -3270,7 +3328,7 @@ index 00445fc7373c70f4cecc4114f9bcfb4b6f27c0e8..67a198fe1ba930836b82fcc22ab25eb1
|
|||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
index 2ac6eb382ad22b9684d460745cecfa9333ccad53..b42527e0307811a3697f6e7b0afc9a10527acbaf 100644
|
||||
index f2737146ffb005dec43bd796043c53397a3b7485..0a5f063bc74e1dae67167537437ebd7e4ddf113a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
@@ -746,6 +746,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
|
@ -3590,10 +3648,10 @@ index 81f16dc1ed6e102af298600db75cab21a09bc00f..18d5a26c34c848241c306241b3ad9825
|
|||
@Override
|
||||
public String getDisplayName() throws IllegalStateException {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
|
||||
index f9b7b8f7ccc95b73967a51420fd6ce88d80d75fe..0de5a46423ae0403dcbfca630dfd7c5ac1e1761d 100644
|
||||
index 78ea79b66cc9e90402ef5cdc2e5e04e0c74b1c26..4fede2161792ba3e7cdf0cc5a1f533188becc6f7 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
|
||||
@@ -290,6 +290,7 @@ public final class CraftChatMessage {
|
||||
@@ -291,6 +291,7 @@ public final class CraftChatMessage {
|
||||
|
||||
public static String fromComponent(Component component) {
|
||||
if (component == null) return "";
|
||||
|
@ -3602,7 +3660,7 @@ index f9b7b8f7ccc95b73967a51420fd6ce88d80d75fe..0de5a46423ae0403dcbfca630dfd7c5a
|
|||
|
||||
boolean hadFormat = false;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 6e990ab85b1510a952de931a0ae4f5b6356da13f..ec5946ce9061573ec7d2a2ec52b71e0228ae0b25 100644
|
||||
index 0d0a5b436ff68d49cf7a043127818bd474562b4b..43e31362a980a4f300864321224bdf3ca92110ff 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -69,6 +69,38 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue