Move Adventure patch up

This commit is contained in:
Riley Park 2022-03-04 13:19:57 -08:00
parent 6d4784392d
commit 42a9c3789d
11 changed files with 140 additions and 173 deletions

View file

@ -75,37 +75,6 @@ index 98afa6a25131dc626ea7a5122f33df6bd2d39178..ac7ecca1a046182e385e2fc77120813e
// workaround for https://github.com/gradle/gradle/issues/4046
inputs.dir("src/main/javadoc").withPropertyName("javadoc-sourceset")
doLast {
diff --git a/src/main/java/co/aikar/timings/TimingsReportListener.java b/src/main/java/co/aikar/timings/TimingsReportListener.java
index ef58a6c00f444bd498a2d8fc4e457236f393954f..ecd149157d4fb80444f34bf5633d74bcdb63dec5 100644
--- a/src/main/java/co/aikar/timings/TimingsReportListener.java
+++ b/src/main/java/co/aikar/timings/TimingsReportListener.java
@@ -15,7 +15,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@SuppressWarnings("WeakerAccess")
-public class TimingsReportListener implements MessageCommandSender {
+public class TimingsReportListener implements net.kyori.adventure.audience.ForwardingAudience, MessageCommandSender { // Paper
private final List<CommandSender> senders;
private final Runnable onDone;
private String timingsURL;
@@ -74,4 +74,17 @@ public class TimingsReportListener implements MessageCommandSender {
this.senders.add(Bukkit.getConsoleSender());
}
}
+
+ // Paper start
+ @Override
+ public void sendMessage(final @NotNull net.kyori.adventure.identity.Identity source, final @NotNull net.kyori.adventure.text.Component message, final @NotNull net.kyori.adventure.audience.MessageType type) {
+ net.kyori.adventure.audience.ForwardingAudience.super.sendMessage(source, message, type);
+ }
+
+ @NotNull
+ @Override
+ public Iterable<? extends net.kyori.adventure.audience.Audience> audiences() {
+ return this.senders;
+ }
+ // Paper end
}
diff --git a/src/main/java/io/papermc/paper/chat/ChatRenderer.java b/src/main/java/io/papermc/paper/chat/ChatRenderer.java
new file mode 100644
index 0000000000000000000000000000000000000000..2fc47afbb233e6e5727a7b672f61b88ad3bab097
@ -498,10 +467,10 @@ index 0000000000000000000000000000000000000000..15ecb12fd2fefcac96edbaef7cdd487a
+ }
+}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 4b5486bec19d330404562814a0c4cf63f2f7ef1d..fc7d17fd3028f790ff9e034e8234bf0506f017c2 100644
index e1cd74a2fb53e054f626641d781e4ac57ea0ea8f..49df3d538413b305acdea8076de5f234cd0b07b9 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -371,7 +371,9 @@ public final class Bukkit {
@@ -357,7 +357,9 @@ public final class Bukkit {
*
* @param message the message
* @return the number of players
@ -511,7 +480,7 @@ index 4b5486bec19d330404562814a0c4cf63f2f7ef1d..fc7d17fd3028f790ff9e034e8234bf05
public static int broadcastMessage(@NotNull String message) {
return server.broadcastMessage(message);
}
@@ -1052,6 +1054,19 @@ public final class Bukkit {
@@ -1039,6 +1041,19 @@ public final class Bukkit {
server.shutdown();
}
@ -531,7 +500,7 @@ index 4b5486bec19d330404562814a0c4cf63f2f7ef1d..fc7d17fd3028f790ff9e034e8234bf05
/**
* Broadcasts the specified message to every user with the given
* permission name.
@@ -1061,6 +1076,21 @@ public final class Bukkit {
@@ -1048,6 +1063,21 @@ public final class Bukkit {
* permissibles} must have to receive the broadcast
* @return number of message recipients
*/
@ -553,7 +522,7 @@ index 4b5486bec19d330404562814a0c4cf63f2f7ef1d..fc7d17fd3028f790ff9e034e8234bf05
public static int broadcast(@NotNull String message, @NotNull String permission) {
return server.broadcast(message, permission);
}
@@ -1299,6 +1329,7 @@ public final class Bukkit {
@@ -1286,6 +1316,7 @@ public final class Bukkit {
return server.createInventory(owner, type);
}
@ -561,7 +530,7 @@ index 4b5486bec19d330404562814a0c4cf63f2f7ef1d..fc7d17fd3028f790ff9e034e8234bf05
/**
* Creates an empty inventory with the specified type and title. If the type
* is {@link InventoryType#CHEST}, the new inventory has a size of 27;
@@ -1324,6 +1355,38 @@ public final class Bukkit {
@@ -1311,6 +1342,38 @@ public final class Bukkit {
* @see InventoryType#isCreatable()
*/
@NotNull
@ -600,7 +569,7 @@ index 4b5486bec19d330404562814a0c4cf63f2f7ef1d..fc7d17fd3028f790ff9e034e8234bf05
public static Inventory createInventory(@Nullable InventoryHolder owner, @NotNull InventoryType type, @NotNull String title) {
return server.createInventory(owner, type, title);
}
@@ -1342,6 +1405,7 @@ public final class Bukkit {
@@ -1329,6 +1392,7 @@ public final class Bukkit {
return server.createInventory(owner, size);
}
@ -608,7 +577,7 @@ index 4b5486bec19d330404562814a0c4cf63f2f7ef1d..fc7d17fd3028f790ff9e034e8234bf05
/**
* Creates an empty inventory of type {@link InventoryType#CHEST} with the
* specified size and title.
@@ -1354,10 +1418,30 @@ public final class Bukkit {
@@ -1341,10 +1405,30 @@ public final class Bukkit {
* @throws IllegalArgumentException if the size is not a multiple of 9
*/
@NotNull
@ -639,7 +608,7 @@ index 4b5486bec19d330404562814a0c4cf63f2f7ef1d..fc7d17fd3028f790ff9e034e8234bf05
/**
* Creates an empty merchant.
*
@@ -1365,7 +1449,20 @@ public final class Bukkit {
@@ -1352,7 +1436,20 @@ public final class Bukkit {
* when the merchant inventory is viewed
* @return a new merchant
*/
@ -660,7 +629,7 @@ index 4b5486bec19d330404562814a0c4cf63f2f7ef1d..fc7d17fd3028f790ff9e034e8234bf05
public static Merchant createMerchant(@Nullable String title) {
return server.createMerchant(title);
}
@@ -1471,22 +1568,47 @@ public final class Bukkit {
@@ -1458,22 +1555,47 @@ public final class Bukkit {
return server.isPrimaryThread();
}
@ -833,10 +802,10 @@ index 803fa0019869127ee8c7e4fb1777a59c43e66f8a..c65f0d6569c130b4920a9e71ad24af64
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index e38a0d7d48a57364bec0c8d1dc16e256622298a0..dd79325a8f52190c44b833870043d167641211a6 100644
index 96819d13fa837c7374c5a13bdcad864c6744f0b5..e9859112a6896c7a7cb14fce545d91827a0e7730 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -58,7 +58,7 @@ import org.jetbrains.annotations.Nullable;
@@ -58,13 +58,13 @@ import org.jetbrains.annotations.Nullable;
/**
* Represents a server implementation.
*/
@ -844,8 +813,6 @@ index e38a0d7d48a57364bec0c8d1dc16e256622298a0..dd79325a8f52190c44b833870043d167
+public interface Server extends PluginMessageRecipient, net.kyori.adventure.audience.ForwardingAudience { // Paper
/**
* Returns the de facto plugins directory, generally used for storing plugin jars to be loaded,
@@ -76,7 +76,7 @@ public interface Server extends PluginMessageRecipient {
* Used for all administrative messages, such as an operator using a
* command.
* <p>
@ -854,7 +821,7 @@ index e38a0d7d48a57364bec0c8d1dc16e256622298a0..dd79325a8f52190c44b833870043d167
*/
public static final String BROADCAST_CHANNEL_ADMINISTRATIVE = "bukkit.broadcast.admin";
@@ -84,7 +84,7 @@ public interface Server extends PluginMessageRecipient {
@@ -72,7 +72,7 @@ public interface Server extends PluginMessageRecipient {
* Used for all announcement messages, such as informing users that a
* player has joined.
* <p>
@ -863,7 +830,7 @@ index e38a0d7d48a57364bec0c8d1dc16e256622298a0..dd79325a8f52190c44b833870043d167
*/
public static final String BROADCAST_CHANNEL_USERS = "bukkit.broadcast.user";
@@ -306,7 +306,9 @@ public interface Server extends PluginMessageRecipient {
@@ -294,7 +294,9 @@ public interface Server extends PluginMessageRecipient {
*
* @param message the message
* @return the number of players
@ -873,7 +840,7 @@ index e38a0d7d48a57364bec0c8d1dc16e256622298a0..dd79325a8f52190c44b833870043d167
public int broadcastMessage(@NotNull String message);
/**
@@ -893,8 +895,33 @@ public interface Server extends PluginMessageRecipient {
@@ -881,8 +883,33 @@ public interface Server extends PluginMessageRecipient {
* @param permission the required permission {@link Permissible
* permissibles} must have to receive the broadcast
* @return number of message recipients
@ -907,7 +874,7 @@ index e38a0d7d48a57364bec0c8d1dc16e256622298a0..dd79325a8f52190c44b833870043d167
/**
* Gets the player by the given name, regardless if they are offline or
@@ -1092,6 +1119,7 @@ public interface Server extends PluginMessageRecipient {
@@ -1080,6 +1107,7 @@ public interface Server extends PluginMessageRecipient {
@NotNull
Inventory createInventory(@Nullable InventoryHolder owner, @NotNull InventoryType type);
@ -915,7 +882,7 @@ index e38a0d7d48a57364bec0c8d1dc16e256622298a0..dd79325a8f52190c44b833870043d167
/**
* Creates an empty inventory with the specified type and title. If the type
* is {@link InventoryType#CHEST}, the new inventory has a size of 27;
@@ -1117,6 +1145,36 @@ public interface Server extends PluginMessageRecipient {
@@ -1105,6 +1133,36 @@ public interface Server extends PluginMessageRecipient {
* @see InventoryType#isCreatable()
*/
@NotNull
@ -952,7 +919,7 @@ index e38a0d7d48a57364bec0c8d1dc16e256622298a0..dd79325a8f52190c44b833870043d167
Inventory createInventory(@Nullable InventoryHolder owner, @NotNull InventoryType type, @NotNull String title);
/**
@@ -1131,6 +1189,22 @@ public interface Server extends PluginMessageRecipient {
@@ -1119,6 +1177,22 @@ public interface Server extends PluginMessageRecipient {
@NotNull
Inventory createInventory(@Nullable InventoryHolder owner, int size) throws IllegalArgumentException;
@ -975,7 +942,7 @@ index e38a0d7d48a57364bec0c8d1dc16e256622298a0..dd79325a8f52190c44b833870043d167
/**
* Creates an empty inventory of type {@link InventoryType#CHEST} with the
* specified size and title.
@@ -1141,10 +1215,13 @@ public interface Server extends PluginMessageRecipient {
@@ -1129,10 +1203,13 @@ public interface Server extends PluginMessageRecipient {
* viewed
* @return a new inventory
* @throws IllegalArgumentException if the size is not a multiple of 9
@ -989,7 +956,7 @@ index e38a0d7d48a57364bec0c8d1dc16e256622298a0..dd79325a8f52190c44b833870043d167
/**
* Creates an empty merchant.
*
@@ -1152,7 +1229,18 @@ public interface Server extends PluginMessageRecipient {
@@ -1140,7 +1217,18 @@ public interface Server extends PluginMessageRecipient {
* when the merchant inventory is viewed
* @return a new merchant
*/
@ -1008,7 +975,7 @@ index e38a0d7d48a57364bec0c8d1dc16e256622298a0..dd79325a8f52190c44b833870043d167
Merchant createMerchant(@Nullable String title);
/**
@@ -1239,20 +1327,41 @@ public interface Server extends PluginMessageRecipient {
@@ -1227,20 +1315,41 @@ public interface Server extends PluginMessageRecipient {
*/
boolean isPrimaryThread();
@ -1050,7 +1017,7 @@ index e38a0d7d48a57364bec0c8d1dc16e256622298a0..dd79325a8f52190c44b833870043d167
String getShutdownMessage();
/**
@@ -1629,7 +1738,9 @@ public interface Server extends PluginMessageRecipient {
@@ -1597,7 +1706,9 @@ public interface Server extends PluginMessageRecipient {
* Sends the component to the player
*
* @param component the components to send
@ -1060,7 +1027,7 @@ index e38a0d7d48a57364bec0c8d1dc16e256622298a0..dd79325a8f52190c44b833870043d167
public void broadcast(@NotNull net.md_5.bungee.api.chat.BaseComponent component) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -1638,7 +1749,9 @@ public interface Server extends PluginMessageRecipient {
@@ -1606,7 +1717,9 @@ public interface Server extends PluginMessageRecipient {
* Sends an array of components as a single message to the player
*
* @param components the components to send
@ -1133,7 +1100,7 @@ index ac5e263d737973af077e3406a84a84baca4370db..2d91924b7f5ef16a91d40cdc1bfc3d68
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index dca2d5045eb52d3d654d5673732761b0575871b4..ce5794d684a1126ec9acbf4af17f5d6fa783f551 100644
index 01e11f882abb6c631f810584aa23646042688435..f43ad19a44f3b7368a1a110cc55247277f4d3751 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -22,6 +22,14 @@ import org.bukkit.plugin.PluginDescriptionFile;
@ -1149,8 +1116,8 @@ index dca2d5045eb52d3d654d5673732761b0575871b4..ce5794d684a1126ec9acbf4af17f5d6f
+ net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer legacyComponentSerializer();
+ // Paper end
void reportTimings(); // Paper
Material toLegacy(Material material);
diff --git a/src/main/java/org/bukkit/Warning.java b/src/main/java/org/bukkit/Warning.java
index efb97712cc9dc7c1e12a59f5b94e4f2ad7c6b7d8..3024468af4c073324e536c1cb26beffb1e09f3f4 100644
--- a/src/main/java/org/bukkit/Warning.java
@ -1309,19 +1276,20 @@ index ab6b0ec328e94bf65a0dafd0403e5ee3b870296c..c8d37184d8e882a4084a1bfef85faa33
/**
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index 03bdc1622791e1206406c87065978688d602e39e..c4dcafac892169a7bfcc065701fffb43c6cfdf44 100644
index 4bfc214685164a38ba4261b2bae7faa8a3bd297e..50e6d45ec9349b56d20e2ffc664eca15ba936cc6 100644
--- a/src/main/java/org/bukkit/command/Command.java
+++ b/src/main/java/org/bukkit/command/Command.java
@@ -32,7 +32,7 @@ public abstract class Command {
@@ -32,8 +32,7 @@ public abstract class Command {
protected String description;
protected String usageMessage;
private String permission;
- private String permissionMessage;
- public org.spigotmc.CustomTimingsHandler timings; // Spigot
+ private net.kyori.adventure.text.Component permissionMessage; // Paper
public co.aikar.timings.Timing timings; // Paper
@NotNull public String getTimingName() {return getName();} // Paper
@@ -186,10 +186,10 @@ public abstract class Command {
protected Command(@NotNull String name) {
this(name, "", "/" + name, new ArrayList<String>());
@@ -186,10 +185,10 @@ public abstract class Command {
if (permissionMessage == null) {
target.sendMessage(ChatColor.RED + "I'm sorry, but you do not have permission to perform this command. Please contact the server administrators if you believe that this is a mistake.");
@ -1336,7 +1304,7 @@ index 03bdc1622791e1206406c87065978688d602e39e..c4dcafac892169a7bfcc065701fffb43
}
return false;
@@ -316,10 +316,12 @@ public abstract class Command {
@@ -317,10 +316,12 @@ public abstract class Command {
* command
*
* @return Permission check failed message
@ -1350,7 +1318,7 @@ index 03bdc1622791e1206406c87065978688d602e39e..c4dcafac892169a7bfcc065701fffb43
}
/**
@@ -380,10 +382,12 @@ public abstract class Command {
@@ -381,10 +382,12 @@ public abstract class Command {
* @param permissionMessage new permission message, null to indicate
* default message, or an empty string to indicate no message
* @return this command object, for chaining
@ -1364,7 +1332,7 @@ index 03bdc1622791e1206406c87065978688d602e39e..c4dcafac892169a7bfcc065701fffb43
return this;
}
@@ -398,6 +402,25 @@ public abstract class Command {
@@ -399,6 +402,25 @@ public abstract class Command {
this.usageMessage = (usage == null) ? "" : usage;
return this;
}
@ -1492,23 +1460,6 @@ index 284be63a125624a8ae43d2c164aede810ce6bfe5..f98d46fa45bb7c842d791b09f082a096
+ }
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/command/MessageCommandSender.java b/src/main/java/org/bukkit/command/MessageCommandSender.java
index a7ef1f51c2b96617a32e6e7b1723e8770ba8a6a8..68daa56546d00089d7d6c13ee897d828c377bbc3 100644
--- a/src/main/java/org/bukkit/command/MessageCommandSender.java
+++ b/src/main/java/org/bukkit/command/MessageCommandSender.java
@@ -49,6 +49,12 @@ public interface MessageCommandSender extends CommandSender {
default String getName() {
throw new NotImplementedException();
}
+ // Paper start
+ @Override
+ default net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component name() {
+ throw new NotImplementedException();
+ }
+ // Paper end
@Override
default boolean isOp() {
diff --git a/src/main/java/org/bukkit/command/PluginCommandYamlParser.java b/src/main/java/org/bukkit/command/PluginCommandYamlParser.java
index a542c4bb3c973bbe4b976642feccde6a4d90cb7b..614cba22c0997dbb45576f800675db4053a9831c 100644
--- a/src/main/java/org/bukkit/command/PluginCommandYamlParser.java
@ -1627,7 +1578,7 @@ index 922d33ff4fa9d901d3c5c0a9f8399ad8aef62c37..cd287978c34873c7122794e4f3e76291
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 7b256be5b82e34a4591d0cc46a2d49aa1269e844..ac7a076d92bfb1d9c6ce8836d08e11f52befabc3 100644
index 5015386d4cd7209a598401932e276077861cea62..29ed72d84b4c4cfcbae5613467076872e0a6871a 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -35,7 +35,28 @@ import org.jetbrains.annotations.Nullable;
@ -2166,7 +2117,7 @@ index 7b256be5b82e34a4591d0cc46a2d49aa1269e844..ac7a076d92bfb1d9c6ce8836d08e11f5
+ @Deprecated // Paper
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
}
diff --git a/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java b/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java
index 63c80b4ee1f7adc8a9efc3b607993104b1991f90..91cab8b13d5bba34007f124838b32a1df58c5ac7 100644
--- a/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java

View file

@ -1878,10 +1878,10 @@ index 0000000000000000000000000000000000000000..a92925d41110226f7fda055b71ce7be6
+}
diff --git a/src/main/java/co/aikar/timings/TimingsReportListener.java b/src/main/java/co/aikar/timings/TimingsReportListener.java
new file mode 100644
index 0000000000000000000000000000000000000000..ef58a6c00f444bd498a2d8fc4e457236f393954f
index 0000000000000000000000000000000000000000..73452e53afc68061245a915c863067f47a1d99f9
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimingsReportListener.java
@@ -0,0 +1,77 @@
@@ -0,0 +1,87 @@
+package co.aikar.timings;
+
+import com.google.common.collect.Lists;
@ -1893,13 +1893,12 @@ index 0000000000000000000000000000000000000000..ef58a6c00f444bd498a2d8fc4e457236
+import org.bukkit.command.RemoteConsoleCommandSender;
+
+import java.util.List;
+import java.util.UUID;
+
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+@SuppressWarnings("WeakerAccess")
+public class TimingsReportListener implements MessageCommandSender {
+public class TimingsReportListener implements net.kyori.adventure.audience.ForwardingAudience, MessageCommandSender {
+ private final List<CommandSender> senders;
+ private final Runnable onDone;
+ private String timingsURL;
@ -1943,6 +1942,17 @@ index 0000000000000000000000000000000000000000..ef58a6c00f444bd498a2d8fc4e457236
+ }
+
+ @Override
+ public void sendMessage(final @NotNull net.kyori.adventure.identity.Identity source, final @NotNull net.kyori.adventure.text.Component message, final @NotNull net.kyori.adventure.audience.MessageType type) {
+ net.kyori.adventure.audience.ForwardingAudience.super.sendMessage(source, message, type);
+ }
+
+ @NotNull
+ @Override
+ public Iterable<? extends net.kyori.adventure.audience.Audience> audiences() {
+ return this.senders;
+ }
+
+ @Override
+ public void sendMessage(@NotNull String message) {
+ senders.forEach((sender) -> sender.sendMessage(message));
+ }
@ -2782,10 +2792,10 @@ index 0000000000000000000000000000000000000000..5989ee21297935651b0edd44b8239e65
+ }
+}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index e1cd74a2fb53e054f626641d781e4ac57ea0ea8f..f8001cafc3494675dfa31c0c5feb975c0f066c5d 100644
index 49df3d538413b305acdea8076de5f234cd0b07b9..b1d770a62e499d909de4352303409fcfdc5d58a9 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -787,7 +787,6 @@ public final class Bukkit {
@@ -789,7 +789,6 @@ public final class Bukkit {
*/
public static void reload() {
server.reload();
@ -2794,10 +2804,10 @@ index e1cd74a2fb53e054f626641d781e4ac57ea0ea8f..f8001cafc3494675dfa31c0c5feb975c
/**
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 96819d13fa837c7374c5a13bdcad864c6744f0b5..7cc8f68205f7c0ec2ebada5030f944675b776c76 100644
index e9859112a6896c7a7cb14fce545d91827a0e7730..465a7f5312a5d5b65f7366f476b7c42795f53105 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1593,6 +1593,26 @@ public interface Server extends PluginMessageRecipient {
@@ -1702,6 +1702,26 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
throw new UnsupportedOperationException("Not supported yet.");
}
@ -2825,18 +2835,18 @@ index 96819d13fa837c7374c5a13bdcad864c6744f0b5..7cc8f68205f7c0ec2ebada5030f94467
* Sends the component to the player
*
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 01e11f882abb6c631f810584aa23646042688435..dca2d5045eb52d3d654d5673732761b0575871b4 100644
index f43ad19a44f3b7368a1a110cc55247277f4d3751..ce5794d684a1126ec9acbf4af17f5d6fa783f551 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -23,6 +23,7 @@ import org.bukkit.plugin.PluginDescriptionFile;
@Deprecated
public interface UnsafeValues {
@@ -31,6 +31,7 @@ public interface UnsafeValues {
net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer legacyComponentSerializer();
// Paper end
+ void reportTimings(); // Paper
Material toLegacy(Material material);
Material fromLegacy(Material material);
@@ -78,4 +79,12 @@ public interface UnsafeValues {
@@ -86,4 +87,12 @@ public interface UnsafeValues {
Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers(Material material, EquipmentSlot slot);
CreativeCategory getCreativeCategory(Material material);
@ -2877,20 +2887,19 @@ index 0000000000000000000000000000000000000000..f9a00aecca5ec41b460bf41dfe1c6969
+ }
+}
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index 4bfc214685164a38ba4261b2bae7faa8a3bd297e..03bdc1622791e1206406c87065978688d602e39e 100644
index 50e6d45ec9349b56d20e2ffc664eca15ba936cc6..c4dcafac892169a7bfcc065701fffb43c6cfdf44 100644
--- a/src/main/java/org/bukkit/command/Command.java
+++ b/src/main/java/org/bukkit/command/Command.java
@@ -33,7 +33,8 @@ public abstract class Command {
@@ -33,6 +33,8 @@ public abstract class Command {
protected String usageMessage;
private String permission;
private String permissionMessage;
- public org.spigotmc.CustomTimingsHandler timings; // Spigot
private net.kyori.adventure.text.Component permissionMessage; // Paper
+ public co.aikar.timings.Timing timings; // Paper
+ @NotNull public String getTimingName() {return getName();} // Paper
protected Command(@NotNull String name) {
this(name, "", "/" + name, new ArrayList<String>());
@@ -47,7 +48,6 @@ public abstract class Command {
@@ -46,7 +48,6 @@ public abstract class Command {
this.usageMessage = (usageMessage == null) ? "/" + name : usageMessage;
this.aliases = aliases;
this.activeAliases = new ArrayList<String>(aliases);
@ -2898,7 +2907,7 @@ index 4bfc214685164a38ba4261b2bae7faa8a3bd297e..03bdc1622791e1206406c87065978688
}
/**
@@ -245,7 +245,6 @@ public abstract class Command {
@@ -244,7 +245,6 @@ public abstract class Command {
}
this.nextLabel = name;
if (!isRegistered()) {
@ -2931,10 +2940,10 @@ index d6c8938b1e13b63116b7b0e074ea8ef5997f8dc3..a6ad94ef98a1df1d2842635d850bc990
}
diff --git a/src/main/java/org/bukkit/command/MessageCommandSender.java b/src/main/java/org/bukkit/command/MessageCommandSender.java
new file mode 100644
index 0000000000000000000000000000000000000000..a7ef1f51c2b96617a32e6e7b1723e8770ba8a6a8
index 0000000000000000000000000000000000000000..f8f0aa688e337222f305fb07f57eec474e3a3a2b
--- /dev/null
+++ b/src/main/java/org/bukkit/command/MessageCommandSender.java
@@ -0,0 +1,129 @@
@@ -0,0 +1,136 @@
+package org.bukkit.command;
+
+import org.apache.commons.lang.NotImplementedException;
@ -2981,6 +2990,13 @@ index 0000000000000000000000000000000000000000..a7ef1f51c2b96617a32e6e7b1723e877
+ return Bukkit.getServer();
+ }
+
+ // Paper start
+ @Override
+ default net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component name() {
+ throw new NotImplementedException();
+ }
+ // Paper end
+
+ @NotNull
+ @Override
+ default String getName() {
@ -3377,11 +3393,11 @@ index 2a145d851ce30360aa39549745bd87590c034584..00000000000000000000000000000000
- // Spigot end
-}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 5015386d4cd7209a598401932e276077861cea62..7b256be5b82e34a4591d0cc46a2d49aa1269e844 100644
index 29ed72d84b4c4cfcbae5613467076872e0a6871a..ac7a076d92bfb1d9c6ce8836d08e11f52befabc3 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1643,7 +1643,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
@@ -1944,7 +1944,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@Deprecated // Paper
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
+

View file

@ -7,7 +7,7 @@ Subject: [PATCH] Add command line option to load extra plugin jars not in the
ex: java -jar paperclip.jar nogui -add-plugin=/path/to/plugin.jar -add-plugin=/path/to/another/plugin_jar.jar
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index f8001cafc3494675dfa31c0c5feb975c0f066c5d..4b5486bec19d330404562814a0c4cf63f2f7ef1d 100644
index b1d770a62e499d909de4352303409fcfdc5d58a9..fc7d17fd3028f790ff9e034e8234bf0506f017c2 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -75,6 +75,20 @@ public final class Bukkit {
@ -32,12 +32,12 @@ index f8001cafc3494675dfa31c0c5feb975c0f066c5d..4b5486bec19d330404562814a0c4cf63
* Attempts to set the {@link Server} singleton.
* <p>
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 7cc8f68205f7c0ec2ebada5030f944675b776c76..e38a0d7d48a57364bec0c8d1dc16e256622298a0 100644
index 465a7f5312a5d5b65f7366f476b7c42795f53105..dd79325a8f52190c44b833870043d167641211a6 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -60,6 +60,18 @@ import org.jetbrains.annotations.Nullable;
*/
public interface Server extends PluginMessageRecipient {
public interface Server extends PluginMessageRecipient, net.kyori.adventure.audience.ForwardingAudience { // Paper
+ /**
+ * Returns the de facto plugins directory, generally used for storing plugin jars to be loaded,

View file

@ -7,12 +7,12 @@ Co-authored-by: zml <zml@stellardrift.ca>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index cc4c008a99bf5a16614d445d2a5e75ce2d5dedb5..043fd38598e36bb96e6d3ab1ab0966435c9aa61b 100644
index 5c7b2850d311e4d54236ba9acce148bca05672fd..15927e8b747e536a5136d9b59edc8d6f50354c42 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -225,4 +225,13 @@ public class PaperConfig {
" - Length: " + timeSummary(Timings.getHistoryLength() / 20) +
" - Server Name: " + timingsServerName);
@@ -185,4 +185,13 @@ public class PaperConfig {
config.addDefault(path, def);
return config.getString(path, config.getString(path));
}
+
+ public static boolean useDisplayNameInQuit = false;
@ -1237,7 +1237,7 @@ index 9d7d7a44616b2b7849c1abd3b9ac77305fdb0815..592b288c5ded992dc3fdf0db5ed08458
// 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 443124a72eef9f60e2941b932a13471dbf1c4f72..9b47d8ab57c3b290173247ba25ad7668f3529903 100644
index c18bed4728f6813aa8d7cf4b1e5e53a092fb1354..082d2fe274a91a76bbef5597eec61d7368cbd06e 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;
@ -1249,7 +1249,7 @@ index 443124a72eef9f60e2941b932a13471dbf1c4f72..9b47d8ab57c3b290173247ba25ad7668
import java.util.concurrent.ExecutionException;
import java.util.concurrent.atomic.AtomicInteger;
import net.minecraft.world.entity.animal.Bucketable;
@@ -383,21 +385,24 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -384,21 +386,24 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
return this.server.isSingleplayerOwner(this.player.getGameProfile());
}
@ -1282,7 +1282,7 @@ index 443124a72eef9f60e2941b932a13471dbf1c4f72..9b47d8ab57c3b290173247ba25ad7668
if (this.cserver.getServer().isRunning()) {
this.cserver.getPluginManager().callEvent(event);
@@ -408,8 +413,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -409,8 +414,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
return;
}
// Send the possibly modified leave message
@ -1292,7 +1292,7 @@ index 443124a72eef9f60e2941b932a13471dbf1c4f72..9b47d8ab57c3b290173247ba25ad7668
// CraftBukkit end
this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), (future) -> {
@@ -1684,9 +1688,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -1685,9 +1689,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
*/
this.player.disconnect();
@ -1307,7 +1307,7 @@ index 443124a72eef9f60e2941b932a13471dbf1c4f72..9b47d8ab57c3b290173247ba25ad7668
}
// CraftBukkit end
this.player.getTextFilter().leave();
@@ -1868,7 +1874,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -1869,7 +1875,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
@ -1321,7 +1321,7 @@ index 443124a72eef9f60e2941b932a13471dbf1c4f72..9b47d8ab57c3b290173247ba25ad7668
Player player = this.getCraftPlayer();
AsyncPlayerChatEvent event = new AsyncPlayerChatEvent(async, player, s, new LazyPlayerSet(this.server));
this.cserver.getPluginManager().callEvent(event);
@@ -2667,30 +2678,30 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -2668,30 +2679,30 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
return;
}
@ -1402,10 +1402,10 @@ 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 5fa0ce6a7f6b8df8993315a9784764f57d59bcf4..bfec1beb0af39e2af6be7c6423bf1eaab32e1062 100644
index ea119e5849c90b25b7e836eb5e7454a391865b81..be9a29f01d59584a1492d925248f0947610ce9d0 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -9,6 +9,7 @@ import com.mojang.logging.LogUtils;
@@ -8,6 +8,7 @@ import com.mojang.logging.LogUtils;
import com.mojang.serialization.DataResult;
import com.mojang.serialization.Dynamic;
import io.netty.buffer.Unpooled;
@ -1413,7 +1413,7 @@ index 5fa0ce6a7f6b8df8993315a9784764f57d59bcf4..bfec1beb0af39e2af6be7c6423bf1eaa
import java.io.File;
import java.net.SocketAddress;
import java.nio.file.Path;
@@ -91,6 +92,7 @@ import net.minecraft.world.scores.Team;
@@ -90,6 +91,7 @@ import net.minecraft.world.scores.Team;
import org.slf4j.Logger;
// CraftBukkit start
@ -1421,7 +1421,7 @@ index 5fa0ce6a7f6b8df8993315a9784764f57d59bcf4..bfec1beb0af39e2af6be7c6423bf1eaa
import com.google.common.base.Predicate;
import java.util.stream.Collectors;
import net.minecraft.server.dedicated.DedicatedServer;
@@ -259,7 +261,7 @@ public abstract class PlayerList {
@@ -258,7 +260,7 @@ public abstract class PlayerList {
}
// CraftBukkit start
chatmessage.withStyle(ChatFormatting.YELLOW);
@ -1430,7 +1430,7 @@ index 5fa0ce6a7f6b8df8993315a9784764f57d59bcf4..bfec1beb0af39e2af6be7c6423bf1eaa
playerconnection.teleport(player.getX(), player.getY(), player.getZ(), player.getYRot(), player.getXRot());
this.players.add(player);
@@ -273,19 +275,18 @@ public abstract class PlayerList {
@@ -272,19 +274,18 @@ public abstract class PlayerList {
// Ensure that player inventory is populated with its viewer
player.containerMenu.transferTo(player.containerMenu, bukkitPlayer);
@ -1455,7 +1455,7 @@ index 5fa0ce6a7f6b8df8993315a9784764f57d59bcf4..bfec1beb0af39e2af6be7c6423bf1eaa
}
// CraftBukkit end
@@ -482,7 +483,7 @@ public abstract class PlayerList {
@@ -481,7 +482,7 @@ public abstract class PlayerList {
}
@ -1464,7 +1464,7 @@ index 5fa0ce6a7f6b8df8993315a9784764f57d59bcf4..bfec1beb0af39e2af6be7c6423bf1eaa
ServerLevel worldserver = entityplayer.getLevel();
entityplayer.awardStat(Stats.LEAVE_GAME);
@@ -493,7 +494,7 @@ public abstract class PlayerList {
@@ -492,7 +493,7 @@ public abstract class PlayerList {
entityplayer.closeContainer();
}
@ -1473,7 +1473,7 @@ index 5fa0ce6a7f6b8df8993315a9784764f57d59bcf4..bfec1beb0af39e2af6be7c6423bf1eaa
this.cserver.getPluginManager().callEvent(playerQuitEvent);
entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage());
@@ -546,7 +547,7 @@ public abstract class PlayerList {
@@ -545,7 +546,7 @@ public abstract class PlayerList {
this.cserver.getScoreboardManager().removePlayer(entityplayer.getBukkitEntity());
// CraftBukkit end
@ -1482,7 +1482,7 @@ index 5fa0ce6a7f6b8df8993315a9784764f57d59bcf4..bfec1beb0af39e2af6be7c6423bf1eaa
}
// CraftBukkit start - Whole method, SocketAddress to LoginListener, added hostname to signature, return EntityPlayer
@@ -592,10 +593,10 @@ public abstract class PlayerList {
@@ -591,10 +592,10 @@ public abstract class PlayerList {
}
// return chatmessage;
@ -1495,7 +1495,7 @@ index 5fa0ce6a7f6b8df8993315a9784764f57d59bcf4..bfec1beb0af39e2af6be7c6423bf1eaa
} else if (this.getIpBans().isBanned(socketaddress) && !this.getIpBans().get(socketaddress).hasExpired()) {
IpBanListEntry ipbanentry = this.ipBans.get(socketaddress);
@@ -605,17 +606,17 @@ public abstract class PlayerList {
@@ -604,17 +605,17 @@ public abstract class PlayerList {
}
// return chatmessage;
@ -1516,7 +1516,7 @@ index 5fa0ce6a7f6b8df8993315a9784764f57d59bcf4..bfec1beb0af39e2af6be7c6423bf1eaa
return null;
}
return entity;
@@ -1124,7 +1125,7 @@ public abstract class PlayerList {
@@ -1122,7 +1123,7 @@ public abstract class PlayerList {
public void removeAll() {
// CraftBukkit start - disconnect safely
for (ServerPlayer player : this.players) {
@ -1635,10 +1635,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 1fe657645c118bc381aeeda0265893a3d4644025..e577c2fb100c217faeaf2d85d6a4374d6de047e1 100644
index 93b70a144bca1e567b0d3f3eafc1dd4b3ac2d2ba..5410f0fe131af48d5c46a0fe6028c2b16eb2de16 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -619,8 +619,10 @@ public final class CraftServer implements Server {
@@ -585,8 +585,10 @@ public final class CraftServer implements Server {
}
@Override
@ -1649,7 +1649,7 @@ index 1fe657645c118bc381aeeda0265893a3d4644025..e577c2fb100c217faeaf2d85d6a4374d
}
@Override
@@ -1449,7 +1451,15 @@ public final class CraftServer implements Server {
@@ -1415,7 +1417,15 @@ public final class CraftServer implements Server {
return this.configuration.getInt("settings.spawn-radius", -1);
}
@ -1665,7 +1665,7 @@ index 1fe657645c118bc381aeeda0265893a3d4644025..e577c2fb100c217faeaf2d85d6a4374d
public String getShutdownMessage() {
return this.configuration.getString("settings.shutdown-message");
}
@@ -1607,7 +1617,20 @@ public final class CraftServer implements Server {
@@ -1573,7 +1583,20 @@ public final class CraftServer implements Server {
}
@Override
@ -1686,7 +1686,7 @@ index 1fe657645c118bc381aeeda0265893a3d4644025..e577c2fb100c217faeaf2d85d6a4374d
Set<CommandSender> recipients = new HashSet<>();
for (Permissible permissible : this.getPluginManager().getPermissionSubscriptions(permission)) {
if (permissible instanceof CommandSender && permissible.hasPermission(permission)) {
@@ -1615,14 +1638,14 @@ public final class CraftServer implements Server {
@@ -1581,14 +1604,14 @@ public final class CraftServer implements Server {
}
}
@ -1703,7 +1703,7 @@ index 1fe657645c118bc381aeeda0265893a3d4644025..e577c2fb100c217faeaf2d85d6a4374d
for (CommandSender recipient : recipients) {
recipient.sendMessage(message);
@@ -1873,6 +1896,14 @@ public final class CraftServer implements Server {
@@ -1839,6 +1862,14 @@ public final class CraftServer implements Server {
return CraftInventoryCreator.INSTANCE.createInventory(owner, type);
}
@ -1718,7 +1718,7 @@ index 1fe657645c118bc381aeeda0265893a3d4644025..e577c2fb100c217faeaf2d85d6a4374d
@Override
public Inventory createInventory(InventoryHolder owner, InventoryType type, String title) {
Validate.isTrue(type.isCreatable(), "Cannot open an inventory of type ", type);
@@ -1885,13 +1916,28 @@ public final class CraftServer implements Server {
@@ -1851,13 +1882,28 @@ public final class CraftServer implements Server {
return CraftInventoryCreator.INSTANCE.createInventory(owner, size);
}
@ -1747,7 +1747,7 @@ index 1fe657645c118bc381aeeda0265893a3d4644025..e577c2fb100c217faeaf2d85d6a4374d
public Merchant createMerchant(String title) {
return new CraftMerchantCustom(title == null ? InventoryType.MERCHANT.getDefaultTitle() : title);
}
@@ -1951,6 +1997,12 @@ public final class CraftServer implements Server {
@@ -1917,6 +1963,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)
}
@ -1760,7 +1760,7 @@ index 1fe657645c118bc381aeeda0265893a3d4644025..e577c2fb100c217faeaf2d85d6a4374d
@Override
public String getMotd() {
return this.console.getMotd();
@@ -2394,5 +2446,15 @@ public final class CraftServer implements Server {
@@ -2341,5 +2393,15 @@ public final class CraftServer implements Server {
return null;
}
}
@ -1808,7 +1808,7 @@ index 794ed40db102370338ee227ffa4e1801fd741284..5963fa56e7dcd61336a14fa1035c6c14
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index cf85183a4026fca981fcb44896d7210b5fc31c2f..7e5fc58f43836edab3696b9644264434c5a95a2f 100644
index 70aa37fe043f56ef1b2f722ca946c4ac2cf4a98b..1039517ead86512a34e07b44b131981c1dea7b00 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 {
@ -2285,7 +2285,7 @@ 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 74db150aed0744d62779e00cad8bfa25cede76ab..3710423e2181533056bb87c40e129eb5d17a9afd 100644
index 76160b76d7d469fb75e733c24d3f1ddf4796485e..65c54d3f52cf5977cf2274d8d5867570082bd8c4 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -262,14 +262,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -3457,7 +3457,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 4e2ee277fc79bae46549861f7af3a0b0a02626b0..d8a0b596e9abef83c9ffc851f45cce4fe6e50b2f 100644
index 6e990ab85b1510a952de931a0ae4f5b6356da13f..5e5904e24bb9e4992567190cf6b40fe84f9a8a55 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 {

View file

@ -690,7 +690,7 @@ index 0000000000000000000000000000000000000000..e3b74dbdf8e14219a56fab939f3174e0
+ }
+}
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 5c7b2850d311e4d54236ba9acce148bca05672fd..8c1bcf84e9a99af4f12c45c8f14ca1fa6cf3b1f1 100644
index 15927e8b747e536a5136d9b59edc8d6f50354c42..64511d966043ca5a3c2b8588ef387ea37bf2de93 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -42,6 +42,7 @@ public class PaperConfig {

View file

@ -669,7 +669,7 @@ index 0000000000000000000000000000000000000000..0fda52841b5e1643efeda92106124998
+ }
+}
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 8c1bcf84e9a99af4f12c45c8f14ca1fa6cf3b1f1..cc4c008a99bf5a16614d445d2a5e75ce2d5dedb5 100644
index 64511d966043ca5a3c2b8588ef387ea37bf2de93..a0f55d6e1096af6f59e7e7ffdc27cdd29cbac9a6 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -14,12 +14,15 @@ import java.util.concurrent.TimeUnit;
@ -688,9 +688,9 @@ index 8c1bcf84e9a99af4f12c45c8f14ca1fa6cf3b1f1..cc4c008a99bf5a16614d445d2a5e75ce
public class PaperConfig {
@@ -191,4 +194,35 @@ public class PaperConfig {
config.addDefault(path, def);
return config.getString(path, config.getString(path));
@@ -200,4 +203,35 @@ public class PaperConfig {
}
useDisplayNameInQuit = getBoolean("settings.use-display-name-in-quit-message", useDisplayNameInQuit);
}
+
+ public static String timingsServerName;
@ -1320,10 +1320,10 @@ index 7564d58b7cbf48c2aaa2e6f823dc88122aecdd6c..74571a05f8d69e068c615179782def09
this.entityManager.saveAll();
} else {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index c18bed4728f6813aa8d7cf4b1e5e53a092fb1354..443124a72eef9f60e2941b932a13471dbf1c4f72 100644
index 082d2fe274a91a76bbef5597eec61d7368cbd06e..9b47d8ab57c3b290173247ba25ad7668f3529903 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -208,6 +208,7 @@ import org.bukkit.inventory.CraftingInventory;
@@ -210,6 +210,7 @@ import org.bukkit.inventory.CraftingInventory;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.InventoryView;
import org.bukkit.inventory.SmithingInventory;
@ -1331,7 +1331,7 @@ index c18bed4728f6813aa8d7cf4b1e5e53a092fb1354..443124a72eef9f60e2941b932a13471d
// CraftBukkit end
public class ServerGamePacketListenerImpl implements ServerPlayerConnection, ServerGamePacketListener {
@@ -286,7 +287,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -288,7 +289,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
// CraftBukkit end
public void tick() {
@ -1339,7 +1339,7 @@ index c18bed4728f6813aa8d7cf4b1e5e53a092fb1354..443124a72eef9f60e2941b932a13471d
this.resetPosition();
this.player.xo = this.player.getX();
this.player.yo = this.player.getY();
@@ -362,7 +362,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -364,7 +364,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854
this.disconnect(new TranslatableComponent("multiplayer.disconnect.idling"));
}
@ -1347,7 +1347,7 @@ index c18bed4728f6813aa8d7cf4b1e5e53a092fb1354..443124a72eef9f60e2941b932a13471d
}
@@ -1934,7 +1933,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -1945,7 +1944,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
// CraftBukkit end
private void handleCommand(String input) {
@ -1356,7 +1356,7 @@ index c18bed4728f6813aa8d7cf4b1e5e53a092fb1354..443124a72eef9f60e2941b932a13471d
// CraftBukkit start - whole method
if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + input);
@@ -1945,7 +1944,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -1956,7 +1955,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.cserver.getPluginManager().callEvent(event);
if (event.isCancelled()) {
@ -1365,7 +1365,7 @@ index c18bed4728f6813aa8d7cf4b1e5e53a092fb1354..443124a72eef9f60e2941b932a13471d
return;
}
@@ -1958,7 +1957,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -1969,7 +1968,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
java.util.logging.Logger.getLogger(ServerGamePacketListenerImpl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
return;
} finally {
@ -1375,7 +1375,7 @@ index c18bed4728f6813aa8d7cf4b1e5e53a092fb1354..443124a72eef9f60e2941b932a13471d
// this.server.getCommands().performCommand(this.player.createCommandSourceStack(), s);
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index ea119e5849c90b25b7e836eb5e7454a391865b81..5fa0ce6a7f6b8df8993315a9784764f57d59bcf4 100644
index be9a29f01d59584a1492d925248f0947610ce9d0..bfec1beb0af39e2af6be7c6423bf1eaab32e1062 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1,5 +1,6 @@
@ -1385,7 +1385,7 @@ index ea119e5849c90b25b7e836eb5e7454a391865b81..5fa0ce6a7f6b8df8993315a9784764f5
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
@@ -1012,10 +1013,11 @@ public abstract class PlayerList {
@@ -1013,10 +1014,11 @@ public abstract class PlayerList {
}
public void saveAll() {
@ -1700,10 +1700,10 @@ index 95abf42577725383a2b49242c28b81beef487ee5..4e5cfc508e356691a9a249013553f97e
};
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 93b70a144bca1e567b0d3f3eafc1dd4b3ac2d2ba..420ca3fa5b84b3dc178496343062ec3f42dd5ae4 100644
index 5410f0fe131af48d5c46a0fe6028c2b16eb2de16..0f1784e2cdde46f2213e540f1959a9c42d5db0c0 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2280,12 +2280,31 @@ public final class CraftServer implements Server {
@@ -2332,12 +2332,31 @@ public final class CraftServer implements Server {
private final org.bukkit.Server.Spigot spigot = new org.bukkit.Server.Spigot()
{
@ -1905,10 +1905,10 @@ index b0ffa23faf62629043dfd613315eaf9c5fcc2cfe..00000000000000000000000000000000
- }
-}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 76160b76d7d469fb75e733c24d3f1ddf4796485e..74db150aed0744d62779e00cad8bfa25cede76ab 100644
index 65c54d3f52cf5977cf2274d8d5867570082bd8c4..3710423e2181533056bb87c40e129eb5d17a9afd 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1915,6 +1915,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2188,6 +2188,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
packet.components = components;
CraftPlayer.this.getHandle().connection.send(packet);
}
@ -2101,10 +2101,10 @@ index e52ef47b783785dc214746b678e7b549aea9a274..3d90b3426873a3528af14f7f1ab0adae
this.value = value;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 6e990ab85b1510a952de931a0ae4f5b6356da13f..4e2ee277fc79bae46549861f7af3a0b0a02626b0 100644
index 5e5904e24bb9e4992567190cf6b40fe84f9a8a55..d8a0b596e9abef83c9ffc851f45cce4fe6e50b2f 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -185,6 +185,12 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -217,6 +217,12 @@ public final class CraftMagicNumbers implements UnsafeValues {
}
// Paper end
// ========================================================================
@ -2117,7 +2117,7 @@ index 6e990ab85b1510a952de931a0ae4f5b6356da13f..4e2ee277fc79bae46549861f7af3a0b0
public static byte toLegacyData(BlockState data) {
return CraftLegacy.toLegacyData(data);
@@ -378,6 +384,13 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -410,6 +416,13 @@ public final class CraftMagicNumbers implements UnsafeValues {
return CraftCreativeCategory.fromNMS(category);
}

View file

@ -7,7 +7,7 @@ Subject: [PATCH] Add command line option to load extra plugin jars not in the
ex: java -jar paperclip.jar nogui -add-plugin=/path/to/plugin.jar -add-plugin=/path/to/another/plugin_jar.jar
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 14b028b75470b164e64a60cc47a2938ba54b3652..1fe657645c118bc381aeeda0265893a3d4644025 100644
index 0f1784e2cdde46f2213e540f1959a9c42d5db0c0..ba53a17a8730344882502995245171190b2de5ee 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -398,10 +398,15 @@ public final class CraftServer implements Server {
@ -66,10 +66,10 @@ index 14b028b75470b164e64a60cc47a2938ba54b3652..1fe657645c118bc381aeeda0265893a3
if (type == PluginLoadOrder.STARTUP) {
this.helpMap.clear();
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 70aa37fe043f56ef1b2f722ca946c4ac2cf4a98b..cf85183a4026fca981fcb44896d7210b5fc31c2f 100644
index 1039517ead86512a34e07b44b131981c1dea7b00..7e5fc58f43836edab3696b9644264434c5a95a2f 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -136,6 +136,12 @@ public class Main {
@@ -142,6 +142,12 @@ public class Main {
.ofType(File.class)
.defaultsTo(new File("paper.yml"))
.describedAs("Yml file");

View file

@ -16,12 +16,12 @@ modify that. Under the previous logic, plugins were unable (cleanly) override pe
A config option has been added for those who depend on the previous behavior, but I don't expect that.
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 043fd38598e36bb96e6d3ab1ab0966435c9aa61b..768581056d228303937814af2421ecad732d3132 100644
index a0f55d6e1096af6f59e7e7ffdc27cdd29cbac9a6..52ff230d3fc5fb27178a657a5a9d244c6a2f43da 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -234,4 +234,9 @@ public class PaperConfig {
}
useDisplayNameInQuit = getBoolean("settings.use-display-name-in-quit-message", useDisplayNameInQuit);
" - Length: " + timeSummary(Timings.getHistoryLength() / 20) +
" - Server Name: " + timingsServerName);
}
+
+ public static boolean loadPermsBeforePlugins = true;
@ -30,7 +30,7 @@ index 043fd38598e36bb96e6d3ab1ab0966435c9aa61b..768581056d228303937814af2421ecad
+ }
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 02674288c62493c22e5e21b42a2d4386b5a42a1d..c30eb1c910147ddd6237078367ce29f9e015af9e 100644
index b5cc9698a1f7723ac9b3032286f2d90e2030f379..9c618bd3543862eed434d4f23bb1c5425ed7647d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -455,6 +455,7 @@ public final class CraftServer implements Server {