Fix Adventure support in UnknownCommandEvent (#5664)

This commit is contained in:
LemonCaramel 2021-05-18 13:54:25 +09:00 committed by GitHub
parent 45e19ffb00
commit 51e1e58d2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 55 additions and 71 deletions

View File

@ -5,35 +5,19 @@ Subject: [PATCH] Add UnknownCommandEvent
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 86d069819b97b7fe60acd7f4bdb0c4a67565a31e..54f924685df58d558cc9488c338c4a479d403791 100644 index 86d069819b97b7fe60acd7f4bdb0c4a67565a31e..3194bb89c6bd97d780c3a4789a23ad5a4c43f85d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -104,6 +104,7 @@ import net.minecraft.world.level.storage.WorldNBTStorage; @@ -792,7 +792,13 @@ public final class CraftServer implements Server {
import net.minecraft.world.level.storage.loot.LootTableRegistry;
import net.minecraft.world.phys.Vec3D;
import org.apache.commons.lang.Validate;
+import org.apache.commons.lang3.StringUtils;
import org.bukkit.BanList;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
@@ -177,6 +178,7 @@ import org.bukkit.craftbukkit.util.Versioning;
import org.bukkit.craftbukkit.util.permissions.CraftDefaultPermissions;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
+import org.bukkit.event.command.UnknownCommandEvent; // Paper
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.event.player.PlayerChatTabCompleteEvent;
import org.bukkit.event.server.BroadcastMessageEvent;
@@ -792,7 +794,13 @@ public final class CraftServer implements Server {
// Spigot start // Spigot start
if (!org.spigotmc.SpigotConfig.unknownCommandMessage.isEmpty()) { if (!org.spigotmc.SpigotConfig.unknownCommandMessage.isEmpty()) {
- sender.sendMessage(org.spigotmc.SpigotConfig.unknownCommandMessage); - sender.sendMessage(org.spigotmc.SpigotConfig.unknownCommandMessage);
+ // Paper start + // Paper start
+ UnknownCommandEvent event = new UnknownCommandEvent(sender, commandLine, org.spigotmc.SpigotConfig.unknownCommandMessage); + org.bukkit.event.command.UnknownCommandEvent event = new org.bukkit.event.command.UnknownCommandEvent(sender, commandLine, org.spigotmc.SpigotConfig.unknownCommandMessage);
+ Bukkit.getServer().getPluginManager().callEvent(event); + Bukkit.getServer().getPluginManager().callEvent(event);
+ if (StringUtils.isNotEmpty(event.getMessage())) { + if (event.message() != null) {
+ sender.sendMessage(event.getMessage()); + sender.sendMessage(event.message());
+ } + }
+ // Paper end + // Paper end
} }

View File

@ -517,10 +517,10 @@ index b9f94f957dd5372c8b02d785204690e4ade36a98..692d95c94df85d752a3ddc66e1f2af76
private volatile long c; private volatile long c;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 54f924685df58d558cc9488c338c4a479d403791..2f9d649bd7b59b36d23316707da7e31430f8a6cb 100644 index 3194bb89c6bd97d780c3a4789a23ad5a4c43f85d..1ca2900e675c8198f0fa9f5bd98161dec057aa85 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -226,6 +226,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException; @@ -224,6 +224,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException;
import net.md_5.bungee.api.chat.BaseComponent; // Spigot import net.md_5.bungee.api.chat.BaseComponent; // Spigot
@ -530,7 +530,7 @@ index 54f924685df58d558cc9488c338c4a479d403791..2f9d649bd7b59b36d23316707da7e314
public final class CraftServer implements Server { public final class CraftServer implements Server {
private final String serverName = "Paper"; // Paper private final String serverName = "Paper"; // Paper
private final String serverVersion; private final String serverVersion;
@@ -2314,5 +2317,24 @@ public final class CraftServer implements Server { @@ -2312,5 +2315,24 @@ public final class CraftServer implements Server {
public boolean suggestPlayerNamesWhenNullTabCompletions() { public boolean suggestPlayerNamesWhenNullTabCompletions() {
return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions; return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions;
} }

View File

@ -72,10 +72,10 @@ index 3628965d2a18a367c2357b54b65786fb90c38205..fc624315b156f450c1cbc87a81e9eeff
@Override @Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 2f9d649bd7b59b36d23316707da7e31430f8a6cb..fb6a1526384b94495939299b4eef2d1ea2ad7378 100644 index 1ca2900e675c8198f0fa9f5bd98161dec057aa85..b37f4e87b9f6461b575ab36cd75943b553c4b0f4 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1849,7 +1849,7 @@ public final class CraftServer implements Server { @@ -1847,7 +1847,7 @@ public final class CraftServer implements Server {
offers = tabCompleteChat(player, message); offers = tabCompleteChat(player, message);
} }

View File

@ -9,10 +9,10 @@ In Offline Mode, will return an Offline UUID
This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index fb6a1526384b94495939299b4eef2d1ea2ad7378..ce08e0d14cc9ab1fd6d56900fd48268649e01f03 100644 index b37f4e87b9f6461b575ab36cd75943b553c4b0f4..2bdee3fe7ad763a3b15259534796a9f457db7ee6 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1516,6 +1516,25 @@ public final class CraftServer implements Server { @@ -1514,6 +1514,25 @@ public final class CraftServer implements Server {
return recipients.size(); return recipients.size();
} }

View File

@ -48,10 +48,10 @@ index 5bbd3bb52b76b8b6cdf90c94bcb29f122f31c543..52c0dd4f2779125116d9dcccc2aef7a1
long start = System.nanoTime(), curTime, tickSection = start; // Paper - Further improve server tick loop long start = System.nanoTime(), curTime, tickSection = start; // Paper - Further improve server tick loop
lastTick = start - TICK_TIME; // Paper lastTick = start - TICK_TIME; // Paper
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index ce08e0d14cc9ab1fd6d56900fd48268649e01f03..dad096e9bd7efeed59fd484ce6c93334f7adeaa9 100644 index 2bdee3fe7ad763a3b15259534796a9f457db7ee6..04e20cb1efb7dd4be13e7c01f86f671bc9924314 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -812,6 +812,7 @@ public final class CraftServer implements Server { @@ -810,6 +810,7 @@ public final class CraftServer implements Server {
@Override @Override
public void reload() { public void reload() {
@ -59,7 +59,7 @@ index ce08e0d14cc9ab1fd6d56900fd48268649e01f03..dad096e9bd7efeed59fd484ce6c93334
reloadCount++; reloadCount++;
configuration = YamlConfiguration.loadConfiguration(getConfigFile()); configuration = YamlConfiguration.loadConfiguration(getConfigFile());
commandsConfiguration = YamlConfiguration.loadConfiguration(getCommandsConfigFile()); commandsConfiguration = YamlConfiguration.loadConfiguration(getCommandsConfigFile());
@@ -930,6 +931,7 @@ public final class CraftServer implements Server { @@ -928,6 +929,7 @@ public final class CraftServer implements Server {
enablePlugins(PluginLoadOrder.STARTUP); enablePlugins(PluginLoadOrder.STARTUP);
enablePlugins(PluginLoadOrder.POSTWORLD); enablePlugins(PluginLoadOrder.POSTWORLD);
getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.RELOAD)); getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.RELOAD));

View File

@ -288,10 +288,10 @@ index 21e70a133278d85ecd65fec36a273ed4faabf6cc..36f747af18347197bab7c335d5d7dfc0
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index dad096e9bd7efeed59fd484ce6c93334f7adeaa9..174b87def18b2c39fb03ccedf0082720f0987cb5 100644 index 04e20cb1efb7dd4be13e7c01f86f671bc9924314..63f24b977d11fc2658f8ec23c65029f3baf551f5 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -684,7 +684,7 @@ public final class CraftServer implements Server { @@ -682,7 +682,7 @@ public final class CraftServer implements Server {
@Override @Override
public long getConnectionThrottle() { public long getConnectionThrottle() {
// Spigot Start - Automatically set connection throttle for bungee configurations // Spigot Start - Automatically set connection throttle for bungee configurations

View File

@ -29,10 +29,10 @@ index 13edb435b3fa65b4980bd7472aa5a5196f4d5b2b..469f78775b03cf363d88e35c69c0dc18
Object val = config.get("settings.save-player-data"); Object val = config.get("settings.save-player-data");
if (val instanceof Boolean) { if (val instanceof Boolean) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 174b87def18b2c39fb03ccedf0082720f0987cb5..b46fe9254a2dce30db9733281e4d36daa9d08e01 100644 index 63f24b977d11fc2658f8ec23c65029f3baf551f5..d44ff2830b6c74f301108f31432627426ca41b9a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2339,6 +2339,11 @@ public final class CraftServer implements Server { @@ -2337,6 +2337,11 @@ public final class CraftServer implements Server {
return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions; return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions;
} }

View File

@ -29,10 +29,10 @@ index fa7935cccb450ae5f782fec5ebe27275fe6dd510..5a5e097b131500d7cb9f61ea0f96f900
public boolean isDebugging() { public boolean isDebugging() {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index b46fe9254a2dce30db9733281e4d36daa9d08e01..08327d80cca5e3fea513260c403c1839e06219a3 100644 index d44ff2830b6c74f301108f31432627426ca41b9a..4b9fa3d5133839e3bd26bb28d485928e6f1d6de3 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1838,7 +1838,7 @@ public final class CraftServer implements Server { @@ -1836,7 +1836,7 @@ public final class CraftServer implements Server {
@Override @Override
public boolean isPrimaryThread() { public boolean isPrimaryThread() {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Expose the internal current tick
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 08327d80cca5e3fea513260c403c1839e06219a3..1b2bd7e51aff16c01058e7b2aadd97ff657d6de0 100644 index 4b9fa3d5133839e3bd26bb28d485928e6f1d6de3..363a0b60e65e0edbc7b73c956af56b4607051a41 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2362,5 +2362,10 @@ public final class CraftServer implements Server { @@ -2360,5 +2360,10 @@ public final class CraftServer implements Server {
} }
return new com.destroystokyo.paper.profile.CraftPlayerProfile(uuid, name); return new com.destroystokyo.paper.profile.CraftPlayerProfile(uuid, name);
} }

View File

@ -147,10 +147,10 @@ index 5e6ca8690c5cb312e805798e8483ac701439227b..506edef56ef6012424556f058996dbf6
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 1b2bd7e51aff16c01058e7b2aadd97ff657d6de0..2a1b0cbb09ebd35d7008ede9a3f1241ff616e90b 100644 index 363a0b60e65e0edbc7b73c956af56b4607051a41..eddd35b6976eefe56c04803932ae6951d1d120c2 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2200,6 +2200,16 @@ public final class CraftServer implements Server { @@ -2198,6 +2198,16 @@ public final class CraftServer implements Server {
net.minecraft.server.MinecraftServer.getServer().tps15.getAverage() net.minecraft.server.MinecraftServer.getServer().tps15.getAverage()
}; };
} }

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Expose MinecraftServer#isRunning
This allows for plugins to detect if the server is actually turning off in onDisable rather than just plugins reloading. This allows for plugins to detect if the server is actually turning off in onDisable rather than just plugins reloading.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 2a1b0cbb09ebd35d7008ede9a3f1241ff616e90b..9325b4f4f668ecd519d9c0106300d2b4c84bea63 100644 index eddd35b6976eefe56c04803932ae6951d1d120c2..d697b1c5e62dce806335f45100bd9d766d12fd19 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2377,5 +2377,10 @@ public final class CraftServer implements Server { @@ -2375,5 +2375,10 @@ public final class CraftServer implements Server {
public int getCurrentTick() { public int getCurrentTick() {
return net.minecraft.server.MinecraftServer.currentTick; return net.minecraft.server.MinecraftServer.currentTick;
} }

View File

@ -345,10 +345,10 @@ index cc41dcd85760b57bb8076b37e9a907d1cb4e12c7..efcfc8f0f45901d14ac8fdf8ed7b0bd6
String msg = "Entity threw exception at " + entity.world.getWorld().getName() + ":" + entity.locX() + "," + entity.locY() + "," + entity.locZ(); String msg = "Entity threw exception at " + entity.world.getWorld().getName() + ":" + entity.locX() + "," + entity.locY() + "," + entity.locZ();
System.err.println(msg); System.err.println(msg);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 9325b4f4f668ecd519d9c0106300d2b4c84bea63..d1eb8818e5d7bb43ef014392a9dd5bc83a34d71a 100644 index d697b1c5e62dce806335f45100bd9d766d12fd19..1ec08b8d1f8104dcdfa00bc0c53c26b7796c514d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1838,7 +1838,7 @@ public final class CraftServer implements Server { @@ -1836,7 +1836,7 @@ public final class CraftServer implements Server {
@Override @Override
public boolean isPrimaryThread() { public boolean isPrimaryThread() {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Expose game version
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index d1eb8818e5d7bb43ef014392a9dd5bc83a34d71a..0196d729406133fe54af88c2c86404bed5905fd4 100644 index 1ec08b8d1f8104dcdfa00bc0c53c26b7796c514d..7d19942373523f18eb9420d0873f2309895b34d7 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -517,6 +517,13 @@ public final class CraftServer implements Server { @@ -515,6 +515,13 @@ public final class CraftServer implements Server {
return bukkitVersion; return bukkitVersion;
} }

View File

@ -1043,10 +1043,10 @@ index 8c8e39d35fb56aa6cf7d456adab01dff5d13a60d..bcf6c924894f49f1c602b83b501f904e
public PathfinderGoalWrapped(int i, PathfinderGoal pathfindergoal) { public PathfinderGoalWrapped(int i, PathfinderGoal pathfindergoal) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 0196d729406133fe54af88c2c86404bed5905fd4..418a383eeabccf3d17fc5b05494918957c4f6ca3 100644 index 7d19942373523f18eb9420d0873f2309895b34d7..cc1316825b639e4b95407922dfa246763db36a9a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2389,5 +2389,11 @@ public final class CraftServer implements Server { @@ -2387,5 +2387,11 @@ public final class CraftServer implements Server {
public boolean isStopping() { public boolean isStopping() {
return net.minecraft.server.MinecraftServer.getServer().hasStopped(); return net.minecraft.server.MinecraftServer.getServer().hasStopped();
} }

View File

@ -22,10 +22,10 @@ index 1e7b3a14210edf453de9c1d9ebbb22be5d9f7a7a..1df2ff45edb4c71bf68ae37fe1cb0e54
// CraftBukkit end // CraftBukkit end
if (this.getServerConnection() != null) { if (this.getServerConnection() != null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 418a383eeabccf3d17fc5b05494918957c4f6ca3..8b185beef31ef0f942249d2e9f76be3ffcc625e0 100644 index cc1316825b639e4b95407922dfa246763db36a9a..870c3fb58971da94dcf4d91c3077bca305f15b2b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -941,6 +941,35 @@ public final class CraftServer implements Server { @@ -939,6 +939,35 @@ public final class CraftServer implements Server {
org.spigotmc.WatchdogThread.hasStarted = true; // Paper - Disable watchdog early timeout on reload org.spigotmc.WatchdogThread.hasStarted = true; // Paper - Disable watchdog early timeout on reload
} }

View File

@ -22,10 +22,10 @@ wants it to collect even faster, they can restore that setting back to 1 instead
Not adding it to .getType() though to keep behavior consistent with vanilla for performance reasons. Not adding it to .getType() though to keep behavior consistent with vanilla for performance reasons.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 8b185beef31ef0f942249d2e9f76be3ffcc625e0..c71814fb169637be83e9f125a91b251d2d6a469f 100644 index 870c3fb58971da94dcf4d91c3077bca305f15b2b..e08d43ae76e9e1d32fe86520f1380b927933f1e7 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -345,7 +345,7 @@ public final class CraftServer implements Server { @@ -343,7 +343,7 @@ public final class CraftServer implements Server {
ambientSpawn = configuration.getInt("spawn-limits.ambient"); ambientSpawn = configuration.getInt("spawn-limits.ambient");
console.autosavePeriod = configuration.getInt("ticks-per.autosave"); console.autosavePeriod = configuration.getInt("ticks-per.autosave");
warningState = WarningState.value(configuration.getString("settings.deprecated-verbose")); warningState = WarningState.value(configuration.getString("settings.deprecated-verbose"));
@ -34,7 +34,7 @@ index 8b185beef31ef0f942249d2e9f76be3ffcc625e0..c71814fb169637be83e9f125a91b251d
minimumAPI = configuration.getString("settings.minimum-api"); minimumAPI = configuration.getString("settings.minimum-api");
loadIcon(); loadIcon();
} }
@@ -836,7 +836,7 @@ public final class CraftServer implements Server { @@ -834,7 +834,7 @@ public final class CraftServer implements Server {
waterAmbientSpawn = configuration.getInt("spawn-limits.water-ambient"); waterAmbientSpawn = configuration.getInt("spawn-limits.water-ambient");
ambientSpawn = configuration.getInt("spawn-limits.ambient"); ambientSpawn = configuration.getInt("spawn-limits.ambient");
warningState = WarningState.value(configuration.getString("settings.deprecated-verbose")); warningState = WarningState.value(configuration.getString("settings.deprecated-verbose"));

View File

@ -27,10 +27,10 @@ index 60ecd3a92af0f1968b10bb8babfb43147ef568d3..9077b70650d70dd294f53a1ef73e86e2
for (int l = 0; l < k; ++l) { for (int l = 0; l < k; ++l) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index c71814fb169637be83e9f125a91b251d2d6a469f..f9ccd6f4be69a2b3770ccb0d0bdd8f96574cc13a 100644 index e08d43ae76e9e1d32fe86520f1380b927933f1e7..cd85c77ae032d15c4bf64a1e93c851aaee53cc02 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2031,6 +2031,32 @@ public final class CraftServer implements Server { @@ -2029,6 +2029,32 @@ public final class CraftServer implements Server {
return new CraftChunkData(world); return new CraftChunkData(world);
} }

View File

@ -18,10 +18,10 @@ index d3f3dc4ad2c758482b7a8d5c07caa526ce1e3424..8bd55e3d2b5142081a7dfe1dbbd36f2f
private EnumGamemode u; private EnumGamemode u;
private boolean v; private boolean v;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index f9ccd6f4be69a2b3770ccb0d0bdd8f96574cc13a..41da3e716427e91e733585583e441dde35f7b493 100644 index cd85c77ae032d15c4bf64a1e93c851aaee53cc02..a44e50c31163d6930ae7ac580b0e8eda31ece9ac 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -617,6 +617,13 @@ public final class CraftServer implements Server { @@ -615,6 +615,13 @@ public final class CraftServer implements Server {
return playerList.getMaxPlayers(); return playerList.getMaxPlayers();
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add getOfflinePlayerIfCached(String)
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 41da3e716427e91e733585583e441dde35f7b493..50a97414b09e45f53e5f34f0af5f63db0e4bab89 100644 index a44e50c31163d6930ae7ac580b0e8eda31ece9ac..f94a0e397e4ff331da7640591ed9644ba5b28ced 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1611,6 +1611,28 @@ public final class CraftServer implements Server { @@ -1609,6 +1609,28 @@ public final class CraftServer implements Server {
return result; return result;
} }

View File

@ -40,10 +40,10 @@ index 0000000000000000000000000000000000000000..2ca8e1bade5450a14125b77540792e0b
+ } + }
+} +}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 50a97414b09e45f53e5f34f0af5f63db0e4bab89..75b3698e27327f0c03bbe3e0a9629239ff92e02e 100644 index f94a0e397e4ff331da7640591ed9644ba5b28ced..4608612583064d9d06365718a7dca864159e38f5 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2220,6 +2220,11 @@ public final class CraftServer implements Server { @@ -2218,6 +2218,11 @@ public final class CraftServer implements Server {
Preconditions.checkArgument(clazz == org.bukkit.Fluid.class, "Fluid namespace must have fluid type"); Preconditions.checkArgument(clazz == org.bukkit.Fluid.class, "Fluid namespace must have fluid type");
return (org.bukkit.Tag<T>) new CraftFluidTag(console.getTagRegistry().getFluidTags(), key); return (org.bukkit.Tag<T>) new CraftFluidTag(console.getTagRegistry().getFluidTags(), key);

View File

@ -66,7 +66,7 @@ index d043b758a68a6afcc36880f255723413fab57c2a..c9a8b7bfc9cd33185d5abedb50ea1bef
try { try {
this.serverThread.join(); this.serverThread.join();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 75b3698e27327f0c03bbe3e0a9629239ff92e02e..15398675035d2955f84fb22b41d4db9e52fb0d4d 100644 index 4608612583064d9d06365718a7dca864159e38f5..ab4ddd62d6361ca99a7ec24c5b83f74314d1494a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -18,6 +18,7 @@ import com.mojang.serialization.Lifecycle; @@ -18,6 +18,7 @@ import com.mojang.serialization.Lifecycle;
@ -77,7 +77,7 @@ index 75b3698e27327f0c03bbe3e0a9629239ff92e02e..15398675035d2955f84fb22b41d4db9e
import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap; import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.File; import java.io.File;
@@ -940,6 +941,7 @@ public final class CraftServer implements Server { @@ -938,6 +939,7 @@ public final class CraftServer implements Server {
plugin.getDescription().getName(), plugin.getDescription().getName(),
"This plugin is not properly shutting down its async tasks when it is being reloaded. This may cause conflicts with the newly loaded version of the plugin" "This plugin is not properly shutting down its async tasks when it is being reloaded. This may cause conflicts with the newly loaded version of the plugin"
)); ));

View File

@ -64,10 +64,10 @@ index 760579921927b4c8b0f20b2611b95fd626e4b27f..3075700dfa992da81b10246fcf7c7ad1
return this.c; return this.c;
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 15398675035d2955f84fb22b41d4db9e52fb0d4d..9e7b6043e6ead590689ed0d7341cd8b16d7f3c39 100644 index ab4ddd62d6361ca99a7ec24c5b83f74314d1494a..16ed4a59fa70b94a80c94c99af74fdce9b44768d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1160,7 +1160,7 @@ public final class CraftServer implements Server { @@ -1158,7 +1158,7 @@ public final class CraftServer implements Server {
} else if (name.equals(levelName + "_the_end")) { } else if (name.equals(levelName + "_the_end")) {
worldKey = net.minecraft.world.level.World.THE_END; worldKey = net.minecraft.world.level.World.THE_END;
} else { } else {
@ -76,7 +76,7 @@ index 15398675035d2955f84fb22b41d4db9e52fb0d4d..9e7b6043e6ead590689ed0d7341cd8b1
} }
WorldServer internal = (WorldServer) new WorldServer(console, console.executorService, worldSession, worlddata, worldKey, dimensionmanager, getServer().worldLoadListenerFactory.create(11), WorldServer internal = (WorldServer) new WorldServer(console, console.executorService, worldSession, worlddata, worldKey, dimensionmanager, getServer().worldLoadListenerFactory.create(11),
@@ -1250,6 +1250,15 @@ public final class CraftServer implements Server { @@ -1248,6 +1248,15 @@ public final class CraftServer implements Server {
return null; return null;
} }

View File

@ -134,7 +134,7 @@ index e87523612d0423d71eab7b9af851c1c268cdf84f..568da9686c41a41e43ede3fe15e0ca53
return this.c; return this.c;
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 9e7b6043e6ead590689ed0d7341cd8b16d7f3c39..3ef4197bcc2a98a983055856c099d41eea595d84 100644 index 16ed4a59fa70b94a80c94c99af74fdce9b44768d..033a0f1852afd6c1fd136ef07b611a9132adfa0c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -18,6 +18,7 @@ import com.mojang.serialization.Lifecycle; @@ -18,6 +18,7 @@ import com.mojang.serialization.Lifecycle;
@ -145,7 +145,7 @@ index 9e7b6043e6ead590689ed0d7341cd8b16d7f3c39..3ef4197bcc2a98a983055856c099d41e
import io.papermc.paper.util.TraceUtil; import io.papermc.paper.util.TraceUtil;
import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap; import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
@@ -267,6 +268,7 @@ public final class CraftServer implements Server { @@ -265,6 +266,7 @@ public final class CraftServer implements Server {
public boolean ignoreVanillaPermissions = false; public boolean ignoreVanillaPermissions = false;
private final List<CraftPlayer> playerView; private final List<CraftPlayer> playerView;
public int reloadCount; public int reloadCount;
@ -153,7 +153,7 @@ index 9e7b6043e6ead590689ed0d7341cd8b16d7f3c39..3ef4197bcc2a98a983055856c099d41e
public static Exception excessiveVelEx; // Paper - Velocity warnings public static Exception excessiveVelEx; // Paper - Velocity warnings
static { static {
@@ -349,6 +351,7 @@ public final class CraftServer implements Server { @@ -347,6 +349,7 @@ public final class CraftServer implements Server {
TicketType.PLUGIN.loadPeriod = Math.min(20, configuration.getInt("chunk-gc.period-in-ticks")); // Paper - cap plugin loads to 1 second TicketType.PLUGIN.loadPeriod = Math.min(20, configuration.getInt("chunk-gc.period-in-ticks")); // Paper - cap plugin loads to 1 second
minimumAPI = configuration.getString("settings.minimum-api"); minimumAPI = configuration.getString("settings.minimum-api");
loadIcon(); loadIcon();
@ -161,7 +161,7 @@ index 9e7b6043e6ead590689ed0d7341cd8b16d7f3c39..3ef4197bcc2a98a983055856c099d41e
} }
public boolean getCommandBlockOverride(String command) { public boolean getCommandBlockOverride(String command) {
@@ -2495,5 +2498,11 @@ public final class CraftServer implements Server { @@ -2493,5 +2496,11 @@ public final class CraftServer implements Server {
public com.destroystokyo.paper.entity.ai.MobGoals getMobGoals() { public com.destroystokyo.paper.entity.ai.MobGoals getMobGoals() {
return mobGoals; return mobGoals;
} }