3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 12:30:06 +01:00

Deprecate ChatColor (#9069)

All API that uses it is deprecated
Dieser Commit ist enthalten in:
Jake Potrebic 2023-04-02 11:53:29 -07:00 committet von GitHub
Ursprung 1d2fe64da8
Commit 9893e2b734
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
34 geänderte Dateien mit 169 neuen und 94 gelöschten Zeilen

Datei anzeigen

@ -959,6 +959,18 @@ index 446e4d21c5b9b624e633875df62160a7351517d9..16ec0cd908659d6d53e565281b8db9f8
public static String getShutdownMessage() { public static String getShutdownMessage() {
return server.getShutdownMessage(); return server.getShutdownMessage();
} }
diff --git a/src/main/java/org/bukkit/ChatColor.java b/src/main/java/org/bukkit/ChatColor.java
index e3f185dc982d1c38195a4e01ddd485c13ffa58c0..ea4ceb643239c26851bacbf45fc3f2efef3bb4be 100644
--- a/src/main/java/org/bukkit/ChatColor.java
+++ b/src/main/java/org/bukkit/ChatColor.java
@@ -11,6 +11,7 @@ import org.jetbrains.annotations.Nullable;
/**
* All supported color values for chat
*/
+@Deprecated // Paper
public enum ChatColor {
/**
* Represents black
diff --git a/src/main/java/org/bukkit/Keyed.java b/src/main/java/org/bukkit/Keyed.java diff --git a/src/main/java/org/bukkit/Keyed.java b/src/main/java/org/bukkit/Keyed.java
index 32c92621c2c15eec14c50965f5ecda00c46e6c80..e076d447da62445764a9776ee2554c077637d270 100644 index 32c92621c2c15eec14c50965f5ecda00c46e6c80..e076d447da62445764a9776ee2554c077637d270 100644
--- a/src/main/java/org/bukkit/Keyed.java --- a/src/main/java/org/bukkit/Keyed.java
@ -1709,10 +1721,10 @@ index 80209bb88a0294d4eedc78509533a6257315d856..75759131bd94b672bec4cd8e271ebff1
if (sendToSource && !(source instanceof ConsoleCommandSender)) { if (sendToSource && !(source instanceof ConsoleCommandSender)) {
source.sendMessage(message); source.sendMessage(message);
diff --git a/src/main/java/org/bukkit/command/CommandSender.java b/src/main/java/org/bukkit/command/CommandSender.java diff --git a/src/main/java/org/bukkit/command/CommandSender.java b/src/main/java/org/bukkit/command/CommandSender.java
index 284be63a125624a8ae43d2c164aede810ce6bfe5..63ec8f2b31e5040eb8d7c7edad011b1976e1e5a3 100644 index 284be63a125624a8ae43d2c164aede810ce6bfe5..4e440880bd82f3cd8b267f00b2fcd725b49ce981 100644
--- a/src/main/java/org/bukkit/command/CommandSender.java --- a/src/main/java/org/bukkit/command/CommandSender.java
+++ b/src/main/java/org/bukkit/command/CommandSender.java +++ b/src/main/java/org/bukkit/command/CommandSender.java
@@ -6,12 +6,13 @@ import org.bukkit.permissions.Permissible; @@ -6,20 +6,28 @@ import org.bukkit.permissions.Permissible;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@ -1724,34 +1736,47 @@ index 284be63a125624a8ae43d2c164aede810ce6bfe5..63ec8f2b31e5040eb8d7c7edad011b19
* *
* @param message Message to be displayed * @param message Message to be displayed
+ * @see #sendMessage(net.kyori.adventure.text.Component) + * @see #sendMessage(net.kyori.adventure.text.Component)
+ * @see #sendPlainMessage(String)
+ * @see #sendRichMessage(String)
*/ */
+ @org.jetbrains.annotations.ApiStatus.Obsolete // Paper
public void sendMessage(@NotNull String message); public void sendMessage(@NotNull String message);
@@ -19,6 +20,7 @@ public interface CommandSender extends Permissible { /**
* Sends this sender multiple messages * Sends this sender multiple messages
* *
* @param messages An array of messages to be displayed * @param messages An array of messages to be displayed
+ * @see #sendMessage(net.kyori.adventure.text.Component) + * @see #sendMessage(net.kyori.adventure.text.Component)
+ * @see #sendPlainMessage(String)
+ * @see #sendRichMessage(String)
*/ */
+ @org.jetbrains.annotations.ApiStatus.Obsolete // Paper
public void sendMessage(@NotNull String... messages); public void sendMessage(@NotNull String... messages);
@@ -27,6 +29,7 @@ public interface CommandSender extends Permissible { /**
@@ -27,7 +35,10 @@ public interface CommandSender extends Permissible {
* *
* @param message Message to be displayed * @param message Message to be displayed
* @param sender The sender of this message * @param sender The sender of this message
+ * @see #sendMessage(net.kyori.adventure.identity.Identified, net.kyori.adventure.text.Component) + * @see #sendMessage(net.kyori.adventure.identity.Identified, net.kyori.adventure.text.Component)
+ * @deprecated sender UUID is ignored
*/ */
+ @Deprecated // Paper
public void sendMessage(@Nullable UUID sender, @NotNull String message); public void sendMessage(@Nullable UUID sender, @NotNull String message);
@@ -35,6 +38,7 @@ public interface CommandSender extends Permissible { /**
@@ -35,7 +46,10 @@ public interface CommandSender extends Permissible {
* *
* @param messages An array of messages to be displayed * @param messages An array of messages to be displayed
* @param sender The sender of this message * @param sender The sender of this message
+ * @see #sendMessage(net.kyori.adventure.identity.Identified, net.kyori.adventure.text.Component) + * @see #sendMessage(net.kyori.adventure.identity.Identified, net.kyori.adventure.text.Component)
+ * @deprecated sender UUID is ignored
*/ */
+ @Deprecated // Paper
public void sendMessage(@Nullable UUID sender, @NotNull String... messages); public void sendMessage(@Nullable UUID sender, @NotNull String... messages);
@@ -61,7 +65,9 @@ public interface CommandSender extends Permissible { /**
@@ -61,7 +75,9 @@ public interface CommandSender extends Permissible {
* Sends this sender a chat component. * Sends this sender a chat component.
* *
* @param component the components to send * @param component the components to send
@ -1761,7 +1786,7 @@ index 284be63a125624a8ae43d2c164aede810ce6bfe5..63ec8f2b31e5040eb8d7c7edad011b19
public void sendMessage(@NotNull net.md_5.bungee.api.chat.BaseComponent component) { public void sendMessage(@NotNull net.md_5.bungee.api.chat.BaseComponent component) {
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");
} }
@@ -70,7 +76,9 @@ public interface CommandSender extends Permissible { @@ -70,7 +86,9 @@ public interface CommandSender extends Permissible {
* Sends an array of components as a single message to the sender. * Sends an array of components as a single message to the sender.
* *
* @param components the components to send * @param components the components to send
@ -1771,7 +1796,7 @@ index 284be63a125624a8ae43d2c164aede810ce6bfe5..63ec8f2b31e5040eb8d7c7edad011b19
public void sendMessage(@NotNull net.md_5.bungee.api.chat.BaseComponent... components) { public void sendMessage(@NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");
} }
@@ -80,7 +88,9 @@ public interface CommandSender extends Permissible { @@ -80,7 +98,9 @@ public interface CommandSender extends Permissible {
* *
* @param component the components to send * @param component the components to send
* @param sender the sender of the message * @param sender the sender of the message
@ -1781,7 +1806,7 @@ index 284be63a125624a8ae43d2c164aede810ce6bfe5..63ec8f2b31e5040eb8d7c7edad011b19
public void sendMessage(@Nullable UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent component) { public void sendMessage(@Nullable UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent component) {
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");
} }
@@ -90,7 +100,9 @@ public interface CommandSender extends Permissible { @@ -90,7 +110,9 @@ public interface CommandSender extends Permissible {
* *
* @param components the components to send * @param components the components to send
* @param sender the sender of the message * @param sender the sender of the message
@ -1791,7 +1816,7 @@ index 284be63a125624a8ae43d2c164aede810ce6bfe5..63ec8f2b31e5040eb8d7c7edad011b19
public void sendMessage(@Nullable UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) { public void sendMessage(@Nullable UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");
} }
@@ -99,4 +111,39 @@ public interface CommandSender extends Permissible { @@ -99,4 +121,39 @@ public interface CommandSender extends Permissible {
@NotNull @NotNull
Spigot spigot(); Spigot spigot();
// Spigot end // Spigot end
@ -1874,6 +1899,27 @@ index fcc34b640265f4dccb46b9f09466ab8e1d96043e..5c813ac024f675951159a59d88d8baa0
+ } + }
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/org/bukkit/conversations/Conversable.java b/src/main/java/org/bukkit/conversations/Conversable.java
index b7d8dd30360a38dbdc7bbce40c8e6ced7261f833..0817f2395c2b18828565435568ce651f5ba99a99 100644
--- a/src/main/java/org/bukkit/conversations/Conversable.java
+++ b/src/main/java/org/bukkit/conversations/Conversable.java
@@ -55,6 +55,7 @@ public interface Conversable {
*
* @param message Message to be displayed
*/
+ @org.jetbrains.annotations.ApiStatus.Obsolete // Paper
public void sendRawMessage(@NotNull String message);
/**
@@ -62,6 +63,8 @@ public interface Conversable {
*
* @param message Message to be displayed
* @param sender The sender of this message
+ * @deprecated sender UUID is ignored
*/
+ @Deprecated // Paper
public void sendRawMessage(@Nullable UUID sender, @NotNull String message);
}
diff --git a/src/main/java/org/bukkit/enchantments/Enchantment.java b/src/main/java/org/bukkit/enchantments/Enchantment.java diff --git a/src/main/java/org/bukkit/enchantments/Enchantment.java b/src/main/java/org/bukkit/enchantments/Enchantment.java
index e2800dc97af5bbb02c555069285a0fa155a9799d..2dc749936df6168073a5bb9f9051d55f8589ac62 100644 index e2800dc97af5bbb02c555069285a0fa155a9799d..2dc749936df6168073a5bb9f9051d55f8589ac62 100644
--- a/src/main/java/org/bukkit/enchantments/Enchantment.java --- a/src/main/java/org/bukkit/enchantments/Enchantment.java

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add BaseComponent sendMessage methods to CommandSender
diff --git a/src/main/java/org/bukkit/command/CommandSender.java b/src/main/java/org/bukkit/command/CommandSender.java diff --git a/src/main/java/org/bukkit/command/CommandSender.java b/src/main/java/org/bukkit/command/CommandSender.java
index 5e7f8822a17459583d9950dc09e3888f492bfd87..d0e1fbb58c5ce71bf2b8d9db9aa3c1b4ca797435 100644 index 4e440880bd82f3cd8b267f00b2fcd725b49ce981..c97970a6a44d61462c9d8d69f6aa12d9a8bb4e05 100644
--- a/src/main/java/org/bukkit/command/CommandSender.java --- a/src/main/java/org/bukkit/command/CommandSender.java
+++ b/src/main/java/org/bukkit/command/CommandSender.java +++ b/src/main/java/org/bukkit/command/CommandSender.java
@@ -1,6 +1,9 @@ @@ -1,6 +1,9 @@
@ -18,7 +18,7 @@ index 5e7f8822a17459583d9950dc09e3888f492bfd87..d0e1fbb58c5ce71bf2b8d9db9aa3c1b4
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.permissions.Permissible; import org.bukkit.permissions.Permissible;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@@ -145,5 +148,33 @@ public interface CommandSender extends net.kyori.adventure.audience.Audience, Pe @@ -155,5 +158,33 @@ public interface CommandSender extends net.kyori.adventure.audience.Audience, Pe
default void sendPlainMessage(final @NotNull String message) { default void sendPlainMessage(final @NotNull String message) {
this.sendMessage(net.kyori.adventure.text.Component.text(message)); this.sendMessage(net.kyori.adventure.text.Component.text(message));
} }

Datei anzeigen

@ -3056,10 +3056,10 @@ index 0000000000000000000000000000000000000000..96e8d03bd4a4d43633a94bb251054610
+} +}
diff --git a/src/main/java/io/papermc/paper/configuration/transformation/global/LegacyPaperConfig.java b/src/main/java/io/papermc/paper/configuration/transformation/global/LegacyPaperConfig.java diff --git a/src/main/java/io/papermc/paper/configuration/transformation/global/LegacyPaperConfig.java b/src/main/java/io/papermc/paper/configuration/transformation/global/LegacyPaperConfig.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..fec6d0b249c6dc7856c5acc4e7dad9fcfabfe35b index 0000000000000000000000000000000000000000..ef0e834c164b0ccc1a61b349348e6799733d66d9
--- /dev/null --- /dev/null
+++ b/src/main/java/io/papermc/paper/configuration/transformation/global/LegacyPaperConfig.java +++ b/src/main/java/io/papermc/paper/configuration/transformation/global/LegacyPaperConfig.java
@@ -0,0 +1,222 @@ @@ -0,0 +1,223 @@
+package io.papermc.paper.configuration.transformation.global; +package io.papermc.paper.configuration.transformation.global;
+ +
+import com.mojang.logging.LogUtils; +import com.mojang.logging.LogUtils;
@ -3261,6 +3261,7 @@ index 0000000000000000000000000000000000000000..fec6d0b249c6dc7856c5acc4e7dad9fc
+ }); + });
+ } + }
+ +
+ @SuppressWarnings("deprecation") // valid use to convert legacy string to mini-message in legacy migration
+ private static String miniMessage(final String input) { + private static String miniMessage(final String input) {
+ return MiniMessage.miniMessage().serialize(LegacyComponentSerializer.legacySection().deserialize(ChatColor.translateAlternateColorCodes('&', input))); + return MiniMessage.miniMessage().serialize(LegacyComponentSerializer.legacySection().deserialize(ChatColor.translateAlternateColorCodes('&', input)));
+ } + }

Datei anzeigen

@ -673,10 +673,10 @@ index 0000000000000000000000000000000000000000..45830cf2b42c2c983cef922c6355e5d6
+} +}
diff --git a/src/main/java/io/papermc/paper/adventure/DisplayNames.java b/src/main/java/io/papermc/paper/adventure/DisplayNames.java diff --git a/src/main/java/io/papermc/paper/adventure/DisplayNames.java b/src/main/java/io/papermc/paper/adventure/DisplayNames.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..3957f68182e8f7a773613a687f1d9a0cfa4f066c index 0000000000000000000000000000000000000000..d496a9a6ad229e42f1c44e31eafa6974b9faced5
--- /dev/null --- /dev/null
+++ b/src/main/java/io/papermc/paper/adventure/DisplayNames.java +++ b/src/main/java/io/papermc/paper/adventure/DisplayNames.java
@@ -0,0 +1,24 @@ @@ -0,0 +1,25 @@
+package io.papermc.paper.adventure; +package io.papermc.paper.adventure;
+ +
+import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; +import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
@ -692,6 +692,7 @@ index 0000000000000000000000000000000000000000..3957f68182e8f7a773613a687f1d9a0c
+ return getLegacy(player.getHandle()); + return getLegacy(player.getHandle());
+ } + }
+ +
+ @SuppressWarnings("deprecation") // Valid suppress due to supporting legacy display name formatting
+ public static String getLegacy(final ServerPlayer player) { + public static String getLegacy(final ServerPlayer player) {
+ final String legacy = player.displayName; + final String legacy = player.displayName;
+ if (legacy != null) { + if (legacy != null) {

Datei anzeigen

@ -167,10 +167,23 @@ index fbc62e2b07a430dea8a827790bda5fbf6f19d05b..07536b696f734fb9e8d0abe1f414ae53
private final org.bukkit.Server.Spigot spigot = new org.bukkit.Server.Spigot() private final org.bukkit.Server.Spigot spigot = new org.bukkit.Server.Spigot()
{ {
diff --git a/src/main/java/org/spigotmc/TicksPerSecondCommand.java b/src/main/java/org/spigotmc/TicksPerSecondCommand.java diff --git a/src/main/java/org/spigotmc/TicksPerSecondCommand.java b/src/main/java/org/spigotmc/TicksPerSecondCommand.java
index 4ab81a99f906e3f28e026d0e50b5b943c1bdcfb5..9bede6a26c08ede063c7a38f1149c811df14b258 100644 index 4ab81a99f906e3f28e026d0e50b5b943c1bdcfb5..b1a72aa3634405f3fce64c66677a75d8f77cb6f6 100644
--- a/src/main/java/org/spigotmc/TicksPerSecondCommand.java --- a/src/main/java/org/spigotmc/TicksPerSecondCommand.java
+++ b/src/main/java/org/spigotmc/TicksPerSecondCommand.java +++ b/src/main/java/org/spigotmc/TicksPerSecondCommand.java
@@ -24,22 +24,30 @@ public class TicksPerSecondCommand extends Command @@ -15,6 +15,12 @@ public class TicksPerSecondCommand extends Command
this.usageMessage = "/tps";
this.setPermission( "bukkit.command.tps" );
}
+ // Paper start
+ private static final net.kyori.adventure.text.Component WARN_MSG = net.kyori.adventure.text.Component.text()
+ .append(net.kyori.adventure.text.Component.text("Warning: ", net.kyori.adventure.text.format.NamedTextColor.RED))
+ .append(net.kyori.adventure.text.Component.text("Memory usage on modern garbage collectors is not a stable value and it is perfectly normal to see it reach max. Please do not pay it much attention.", net.kyori.adventure.text.format.NamedTextColor.GOLD))
+ .build();
+ // Paper end
@Override
public boolean execute(CommandSender sender, String currentAlias, String[] args)
@@ -24,22 +30,33 @@ public class TicksPerSecondCommand extends Command
return true; return true;
} }
@ -186,12 +199,15 @@ index 4ab81a99f906e3f28e026d0e50b5b943c1bdcfb5..9bede6a26c08ede063c7a38f1149c811
+ for ( int i = 0; i < tps.length; i++) { + for ( int i = 0; i < tps.length; i++) {
+ tpsAvg[i] = TicksPerSecondCommand.format( tps[i] ); + tpsAvg[i] = TicksPerSecondCommand.format( tps[i] );
+ } + }
+ sender.sendMessage(ChatColor.GOLD + "TPS from last 1m, 5m, 15m: " + org.apache.commons.lang.StringUtils.join(tpsAvg, ", ")); + sender.sendMessage(net.kyori.adventure.text.Component.text("TPS from last 1m, 5m, 15m: " + org.apache.commons.lang.StringUtils.join(tpsAvg, ", "), net.kyori.adventure.text.format.NamedTextColor.GOLD));
+ if (args.length > 0 && args[0].equals("mem") && sender.hasPermission("bukkit.command.tpsmemory")) { + if (args.length > 0 && args[0].equals("mem") && sender.hasPermission("bukkit.command.tpsmemory")) {
+ sender.sendMessage(ChatColor.GOLD + "Current Memory Usage: " + ChatColor.GREEN + ((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / (1024 * 1024)) + "/" + (Runtime.getRuntime().totalMemory() / (1024 * 1024)) + " mb (Max: " + (Runtime.getRuntime().maxMemory() / (1024 * 1024)) + " mb)"); + sender.sendMessage(net.kyori.adventure.text.Component.text()
+ if (!hasShownMemoryWarning) { + .append(net.kyori.adventure.text.Component.text("Current Memory Usage: ", net.kyori.adventure.text.format.NamedTextColor.GOLD))
+ sender.sendMessage(ChatColor.RED + "Warning: " + ChatColor.GOLD + " Memory usage on modern garbage collectors is not a stable value and it is perfectly normal to see it reach max. Please do not pay it much attention."); + .append(net.kyori.adventure.text.Component.text(((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / (1024 * 1024)) + "/" + (Runtime.getRuntime().totalMemory() / (1024 * 1024)) + " mb (Max: " + (Runtime.getRuntime().maxMemory() / (1024 * 1024)) + " mb)", net.kyori.adventure.text.format.NamedTextColor.GREEN))
+ hasShownMemoryWarning = true; + );
+ if (!this.hasShownMemoryWarning) {
+ sender.sendMessage(WARN_MSG);
+ this.hasShownMemoryWarning = true;
+ } + }
} }
- sender.sendMessage( sb.substring( 0, sb.length() - 2 ) ); - sender.sendMessage( sb.substring( 0, sb.length() - 2 ) );

Datei anzeigen

@ -12,14 +12,20 @@ for this on CB at one point but I can't find it. We may need to do this
ourselves at some point in the future. ourselves at some point in the future.
diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
index 45830cf2b42c2c983cef922c6355e5d6a7cfb982..4d9bc4a62ebae0f3707900503576c64733de639f 100644 index 45830cf2b42c2c983cef922c6355e5d6a7cfb982..951a7df30bd70bb3051c04f592529d560be6948e 100644
--- a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java --- a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
+++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java +++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
@@ -29,7 +29,9 @@ import net.minecraft.network.chat.PlayerChatMessage; @@ -19,6 +19,7 @@ import net.kyori.adventure.audience.Audience;
import net.minecraft.resources.ResourceKey; import net.kyori.adventure.audience.ForwardingAudience;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.text.Component;
+import net.minecraft.ChatFormatting;
import net.minecraft.Optionull;
import net.minecraft.Util;
import net.minecraft.core.registries.Registries;
@@ -30,6 +31,7 @@ import net.minecraft.resources.ResourceKey;
import net.minecraft.server.MinecraftServer; import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.level.ServerPlayer;
+import org.bukkit.ChatColor;
import org.bukkit.command.ConsoleCommandSender; import org.bukkit.command.ConsoleCommandSender;
+import org.bukkit.craftbukkit.CraftWorld; +import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.craftbukkit.entity.CraftPlayer;
@ -30,7 +36,7 @@ index 45830cf2b42c2c983cef922c6355e5d6a7cfb982..4d9bc4a62ebae0f3707900503576c647
static String legacyDisplayName(final CraftPlayer player) { static String legacyDisplayName(final CraftPlayer player) {
+ if (((org.bukkit.craftbukkit.CraftWorld) player.getWorld()).getHandle().paperConfig().scoreboards.useVanillaWorldScoreboardNameColoring) { + if (((org.bukkit.craftbukkit.CraftWorld) player.getWorld()).getHandle().paperConfig().scoreboards.useVanillaWorldScoreboardNameColoring) {
+ return legacySection().serialize(player.teamDisplayName()) + ChatColor.RESET; + return legacySection().serialize(player.teamDisplayName()) + ChatFormatting.RESET;
+ } + }
return player.getDisplayName(); return player.getDisplayName();
} }

Datei anzeigen

@ -26,14 +26,15 @@ index 32ef3edebe94a2014168b7e438752a80b2687e5f..ab6c58eed6707ab7b0aa3e7549a871ad
// Paper end // Paper end
buf.writeComponent(this.text); buf.writeComponent(this.text);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 023e477ebe24aff03767a3179e7b2f0e653ffa12..981ac7ad6efb4024216a0967fd4c2f01245a8816 100644 index 814bcc343fc2568844dd8da1f328fbae8b09f592..ff35189ca0f8c0957fab889039fe2283a190a4d0 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -358,6 +358,26 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -358,6 +358,29 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
// Paper start // Paper start
+ @Override + @Override
+ @Deprecated
+ public void sendActionBar(BaseComponent[] message) { + public void sendActionBar(BaseComponent[] message) {
+ if (getHandle().connection == null) return; + if (getHandle().connection == null) return;
+ net.minecraft.network.protocol.game.ClientboundSetActionBarTextPacket packet = new net.minecraft.network.protocol.game.ClientboundSetActionBarTextPacket((net.minecraft.network.chat.Component) null); + net.minecraft.network.protocol.game.ClientboundSetActionBarTextPacket packet = new net.minecraft.network.protocol.game.ClientboundSetActionBarTextPacket((net.minecraft.network.chat.Component) null);
@ -42,12 +43,14 @@ index 023e477ebe24aff03767a3179e7b2f0e653ffa12..981ac7ad6efb4024216a0967fd4c2f01
+ } + }
+ +
+ @Override + @Override
+ @Deprecated
+ public void sendActionBar(String message) { + public void sendActionBar(String message) {
+ if (getHandle().connection == null || message == null || message.isEmpty()) return; + if (getHandle().connection == null || message == null || message.isEmpty()) return;
+ getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSetActionBarTextPacket(CraftChatMessage.fromStringOrNull(message))); + getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSetActionBarTextPacket(CraftChatMessage.fromStringOrNull(message)));
+ } + }
+ +
+ @Override + @Override
+ @Deprecated
+ public void sendActionBar(char alternateChar, String message) { + public void sendActionBar(char alternateChar, String message) {
+ if (message == null || message.isEmpty()) return; + if (message == null || message.isEmpty()) return;
+ sendActionBar(org.bukkit.ChatColor.translateAlternateColorCodes(alternateChar, message)); + sendActionBar(org.bukkit.ChatColor.translateAlternateColorCodes(alternateChar, message));

Datei anzeigen

@ -14,10 +14,10 @@ public net.minecraft.world.entity.ExperienceOrb durabilityToXp(I)I
public net.minecraft.world.entity.ExperienceOrb xpToDurability(I)I public net.minecraft.world.entity.ExperienceOrb xpToDurability(I)I
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 75017f7464247a4766859250453954c4b775d36f..a1ab7a666e429f0ac9afc1bd8a65866364655b70 100644 index a9494390868b62824fddd2b7a95f52f3ab31d605..61baea9efa7c1b35c437f6f0a4387c7611f401c3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1493,7 +1493,37 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1496,7 +1496,37 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
@Override @Override

Datei anzeigen

@ -55,7 +55,7 @@ index e7442952ef1f03969949014492a7ddc6d0796ba5..69a1852905dd4724c30ac8ab88c14251
public Server getServer() { public Server getServer() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index f19b8258e30133f3111ca27e9082b7f3a4ce3877..53074702d0d606ce0e26c4cf435c3b71b4336f5e 100644 index 61baea9efa7c1b35c437f6f0a4387c7611f401c3..05f43fab1fbc121ae6e5113ba485e0b2b89cb98b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -82,6 +82,7 @@ import net.minecraft.world.entity.ai.attributes.Attributes; @@ -82,6 +82,7 @@ import net.minecraft.world.entity.ai.attributes.Attributes;
@ -78,7 +78,7 @@ index f19b8258e30133f3111ca27e9082b7f3a4ce3877..53074702d0d606ce0e26c4cf435c3b71
@Override @Override
public InetSocketAddress getAddress() { public InetSocketAddress getAddress() {
if (this.getHandle().connection == null) return null; if (this.getHandle().connection == null) return null;
@@ -1643,8 +1639,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1646,8 +1642,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
private void untrackAndHideEntity(org.bukkit.entity.Entity entity) { private void untrackAndHideEntity(org.bukkit.entity.Entity entity) {
// Remove this entity from the hidden player's EntityTrackerEntry // Remove this entity from the hidden player's EntityTrackerEntry
@ -95,7 +95,7 @@ index f19b8258e30133f3111ca27e9082b7f3a4ce3877..53074702d0d606ce0e26c4cf435c3b71
ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId()); ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId());
if (entry != null) { if (entry != null) {
entry.removePlayer(this.getHandle()); entry.removePlayer(this.getHandle());
@@ -1657,8 +1660,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1660,8 +1663,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().connection.send(new ClientboundPlayerInfoRemovePacket(List.of(otherPlayer.getUUID()))); this.getHandle().connection.send(new ClientboundPlayerInfoRemovePacket(List.of(otherPlayer.getUUID())));
} }
} }
@ -104,7 +104,7 @@ index f19b8258e30133f3111ca27e9082b7f3a4ce3877..53074702d0d606ce0e26c4cf435c3b71
} }
void resetAndHideEntity(org.bukkit.entity.Entity entity) { void resetAndHideEntity(org.bukkit.entity.Entity entity) {
@@ -1735,8 +1736,38 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1738,8 +1739,38 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (entry != null && !entry.seenBy.contains(this.getHandle().connection)) { if (entry != null && !entry.seenBy.contains(this.getHandle().connection)) {
entry.updatePlayer(this.getHandle()); entry.updatePlayer(this.getHandle());
} }
@ -144,7 +144,7 @@ index f19b8258e30133f3111ca27e9082b7f3a4ce3877..53074702d0d606ce0e26c4cf435c3b71
} }
void resetAndShowEntity(org.bukkit.entity.Entity entity) { void resetAndShowEntity(org.bukkit.entity.Entity entity) {
@@ -1749,6 +1780,30 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1752,6 +1783,30 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.trackAndShowEntity(entity); this.trackAndShowEntity(entity);
} }
} }

Datei anzeigen

@ -6,16 +6,17 @@ Subject: [PATCH] Call PaperServerListPingEvent for legacy pings
diff --git a/src/main/java/com/destroystokyo/paper/network/PaperLegacyStatusClient.java b/src/main/java/com/destroystokyo/paper/network/PaperLegacyStatusClient.java diff --git a/src/main/java/com/destroystokyo/paper/network/PaperLegacyStatusClient.java b/src/main/java/com/destroystokyo/paper/network/PaperLegacyStatusClient.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..74c012fd40491f1d870fbc1aa8c318a2197eb106 index 0000000000000000000000000000000000000000..cc54b1c207981235b5160e8773b27cf9a5dcd4d5
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/network/PaperLegacyStatusClient.java +++ b/src/main/java/com/destroystokyo/paper/network/PaperLegacyStatusClient.java
@@ -0,0 +1,73 @@ @@ -0,0 +1,75 @@
+package com.destroystokyo.paper.network; +package com.destroystokyo.paper.network;
+ +
+import com.destroystokyo.paper.event.server.PaperServerListPingEvent; +import com.destroystokyo.paper.event.server.PaperServerListPingEvent;
+import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
+import net.minecraft.ChatFormatting;
+import net.minecraft.server.MinecraftServer; +import net.minecraft.server.MinecraftServer;
+import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.StringUtils;
+import org.bukkit.ChatColor;
+ +
+import java.net.InetSocketAddress; +import java.net.InetSocketAddress;
+ +
@ -68,13 +69,14 @@ index 0000000000000000000000000000000000000000..74c012fd40491f1d870fbc1aa8c318a2
+ return event; + return event;
+ } + }
+ +
+ @SuppressWarnings("deprecation") // Valid as this is the legacy status client
+ public static String getMotd(PaperServerListPingEvent event) { + public static String getMotd(PaperServerListPingEvent event) {
+ return getFirstLine(event.getMotd()); + return getFirstLine(event.getMotd());
+ } + }
+ +
+ public static String getUnformattedMotd(PaperServerListPingEvent event) { + public static String getUnformattedMotd(PaperServerListPingEvent event) {
+ // Strip color codes and all other occurrences of the color char (because it's used as delimiter) + // Strip color codes and all other occurrences of the color char (because it's used as delimiter)
+ return getFirstLine(StringUtils.remove(ChatColor.stripColor(event.getMotd()), ChatColor.COLOR_CHAR)); + return getFirstLine(StringUtils.remove(PlainTextComponentSerializer.plainText().serialize(event.motd()), ChatFormatting.PREFIX_CODE));
+ } + }
+ +
+ private static String getFirstLine(String s) { + private static String getFirstLine(String s) {

Datei anzeigen

@ -9,7 +9,7 @@ e.g. servers which allow and support the usage of mod packs.
provide an optional flag to disable this check, at your own risk. provide an optional flag to disable this check, at your own risk.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 53074702d0d606ce0e26c4cf435c3b71b4336f5e..31fbfff6fb79601ade46b9867cd82da9db9cd2bd 100644 index 05f43fab1fbc121ae6e5113ba485e0b2b89cb98b..6d0800737d1e017bc841fddcbd9ac6cb0be0f4fd 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -176,6 +176,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -176,6 +176,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -20,7 +20,7 @@ index 53074702d0d606ce0e26c4cf435c3b71b4336f5e..31fbfff6fb79601ade46b9867cd82da9
// Paper end // Paper end
public CraftPlayer(CraftServer server, ServerPlayer entity) { public CraftPlayer(CraftServer server, ServerPlayer entity) {
@@ -2012,7 +2013,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2015,7 +2016,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Paper end // Paper end
public void addChannel(String channel) { public void addChannel(String channel) {

Datei anzeigen

@ -173,10 +173,10 @@ index 787ccb37a39bb506cf9fd8d54cf772b346981f85..f5b3190ffb9e9f92977afc9e40ddfa15
@Override @Override
public boolean isBlocking() { public boolean isBlocking() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 31fbfff6fb79601ade46b9867cd82da9db9cd2bd..966232147c9a308743a65fe581c84b449de1dbd3 100644 index 6d0800737d1e017bc841fddcbd9ac6cb0be0f4fd..25b3e7f8f8182bb5de491fc2f6debf4d7a8cd252 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1207,7 +1207,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1210,7 +1210,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Close any foreign inventory // Close any foreign inventory
if (this.getHandle().containerMenu != this.getHandle().inventoryMenu) { if (this.getHandle().containerMenu != this.getHandle().inventoryMenu) {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Expose attack cooldown methods for Player
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 966232147c9a308743a65fe581c84b449de1dbd3..8fcffb0a9c3fa97758610371b6d03b0094c43c71 100644 index 25b3e7f8f8182bb5de491fc2f6debf4d7a8cd252..dd22b04a5a30cc1dce87fba6f08f8f183af049a4 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2769,6 +2769,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2772,6 +2772,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this.adventure$pointers; return this.adventure$pointers;
} }

Datei anzeigen

@ -352,10 +352,10 @@ index e38cbdff34479673f1640c46d727f1a807a609c7..dbb4bfb3d1f1ce2e435ca531be36ea44
this.gameEvent(GameEvent.ENTITY_DIE); this.gameEvent(GameEvent.ENTITY_DIE);
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 8fcffb0a9c3fa97758610371b6d03b0094c43c71..c19b004463e491674b6c4bc8bfc8851d4dbb4501 100644 index dd22b04a5a30cc1dce87fba6f08f8f183af049a4..827e749ec994eb3472e5437e0ddf219da39555a4 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2272,7 +2272,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2275,7 +2275,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
public void sendHealthUpdate() { public void sendHealthUpdate() {

Datei anzeigen

@ -106,7 +106,7 @@ index 69a1852905dd4724c30ac8ab88c14251eee2c371..17b3d5de58a9ef3acc67624c46cd6bbd
public Location getLastDeathLocation() { public Location getLastDeathLocation() {
if (this.getData().contains("LastDeathLocation", 10)) { if (this.getData().contains("LastDeathLocation", 10)) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index c19b004463e491674b6c4bc8bfc8851d4dbb4501..66e7fba36b0810a1254f3937988a640db9a0e295 100644 index 827e749ec994eb3472e5437e0ddf219da39555a4..d16cd51e59589cf9059c8c29e6421fd8f4871ca2 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -177,6 +177,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -177,6 +177,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -117,7 +117,7 @@ index c19b004463e491674b6c4bc8bfc8851d4dbb4501..66e7fba36b0810a1254f3937988a640d
// Paper end // Paper end
public CraftPlayer(CraftServer server, ServerPlayer entity) { public CraftPlayer(CraftServer server, ServerPlayer entity) {
@@ -1884,6 +1885,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1887,6 +1888,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.firstPlayed = firstPlayed; this.firstPlayed = firstPlayed;
} }
@ -136,7 +136,7 @@ index c19b004463e491674b6c4bc8bfc8851d4dbb4501..66e7fba36b0810a1254f3937988a640d
public void readExtraData(CompoundTag nbttagcompound) { public void readExtraData(CompoundTag nbttagcompound) {
this.hasPlayedBefore = true; this.hasPlayedBefore = true;
if (nbttagcompound.contains("bukkit")) { if (nbttagcompound.contains("bukkit")) {
@@ -1906,6 +1919,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1909,6 +1922,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
public void setExtraData(CompoundTag nbttagcompound) { public void setExtraData(CompoundTag nbttagcompound) {
@ -145,7 +145,7 @@ index c19b004463e491674b6c4bc8bfc8851d4dbb4501..66e7fba36b0810a1254f3937988a640d
if (!nbttagcompound.contains("bukkit")) { if (!nbttagcompound.contains("bukkit")) {
nbttagcompound.put("bukkit", new CompoundTag()); nbttagcompound.put("bukkit", new CompoundTag());
} }
@@ -1920,6 +1935,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1923,6 +1938,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
data.putLong("firstPlayed", this.getFirstPlayed()); data.putLong("firstPlayed", this.getFirstPlayed());
data.putLong("lastPlayed", System.currentTimeMillis()); data.putLong("lastPlayed", System.currentTimeMillis());
data.putString("lastKnownName", handle.getScoreboardName()); data.putString("lastKnownName", handle.getScoreboardName());

Datei anzeigen

@ -12,10 +12,10 @@ Player we will look at limiting the scope of this change. It appears to
be unintentional in the few cases we've seen so far. be unintentional in the few cases we've seen so far.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 66e7fba36b0810a1254f3937988a640db9a0e295..2977d89a4c38346402527dcaa84b51a7707b2480 100644 index d16cd51e59589cf9059c8c29e6421fd8f4871ca2..fdad04d657612979b5b9d30d132ca38efe81858d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2816,6 +2816,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2819,6 +2819,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void resetCooldown() { public void resetCooldown() {
getHandle().resetAttackStrengthTicker(); getHandle().resetAttackStrengthTicker();
} }

Datei anzeigen

@ -116,10 +116,10 @@ index 71fac1a579b375759462b843d9ef7c8a2a463db5..2d54f2abae82521fbd34aa046f26ec8e
if (getMainArm() != packet.mainHand()) { if (getMainArm() != packet.mainHand()) {
PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(this.getBukkitEntity(), getMainArm() == HumanoidArm.LEFT ? MainHand.LEFT : MainHand.RIGHT); PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(this.getBukkitEntity(), getMainArm() == HumanoidArm.LEFT ? MainHand.LEFT : MainHand.RIGHT);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 2977d89a4c38346402527dcaa84b51a7707b2480..2cfe08bc1de682c845718e758ede718e94384d4d 100644 index fdad04d657612979b5b9d30d132ca38efe81858d..254ff289883b37d42095ee286b138015f8dfb81f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -618,6 +618,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -621,6 +621,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
connection.disconnect(message == null ? net.kyori.adventure.text.Component.empty() : message); connection.disconnect(message == null ? net.kyori.adventure.text.Component.empty() : message);
} }
} }

Datei anzeigen

@ -56,10 +56,10 @@ index 1517c09ccd95448cb0fce0f9ffbb7bd2e704113b..221a695acf3cbeaeaf9eda818b6cf809
return (!this.player.joining && !this.connection.isConnected()) || this.processedDisconnect; // Paper return (!this.player.joining && !this.connection.isConnected()) || this.processedDisconnect; // Paper
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 2cfe08bc1de682c845718e758ede718e94384d4d..15caedd46ca0b4dba4d1d0fb3cabd24d324390fa 100644 index 254ff289883b37d42095ee286b138015f8dfb81f..56f88fbc08154d30348bdead4e79b5f96b0aeb0d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2943,6 +2943,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2946,6 +2946,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Paper end // Paper end
}; };

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Player elytra boost API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index d127eba33abe5c0ae711221504b67cc2af3b0822..42f5a42b916e0d8ce9583d06c1ad3bc5ee6c4c9c 100644 index 56f88fbc08154d30348bdead4e79b5f96b0aeb0d..f26aa477634f50e1e868c2f56006a5f058223916 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -640,6 +640,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -643,6 +643,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
throw new RuntimeException("Unknown settings type"); throw new RuntimeException("Unknown settings type");
} }

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Fix Player spawnParticle x/y/z precision loss
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index cd6a04777fadd22053ff35be18652a8273b217d2..c0338f597b9c50218862005220a8753d5822a6e4 100644 index f26aa477634f50e1e868c2f56006a5f058223916..62d646c9bc9f14d6a66a0f1a32164882ef269f67 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2465,7 +2465,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2468,7 +2468,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (data != null && !particle.getDataType().isInstance(data)) { if (data != null && !particle.getDataType().isInstance(data)) {
throw new IllegalArgumentException("data should be " + particle.getDataType() + " got " + data.getClass()); throw new IllegalArgumentException("data should be " + particle.getDataType() + " got " + data.getClass());
} }

Datei anzeigen

@ -35,7 +35,7 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/
index c0338f597b9c50218862005220a8753d5822a6e4..0b0dc51dfb7174c359305448575ae714398917e4 100644 index c0338f597b9c50218862005220a8753d5822a6e4..0b0dc51dfb7174c359305448575ae714398917e4 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -654,6 +654,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -657,6 +657,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
? (org.bukkit.entity.Firework) entity.getBukkitEntity() ? (org.bukkit.entity.Firework) entity.getBukkitEntity()
: null; : null;
} }

Datei anzeigen

@ -142,10 +142,10 @@ index dffb219c0abdac46320aaec168e232df322a4bca..8987bbb4feed89c44e3615a58dac321a
} }
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0b0dc51dfb7174c359305448575ae714398917e4..86276267f68d68c50184343186fd8d8867b1dc3f 100644 index a927c725d08738fdd0f42e21efd09362e9da938d..2095d844bd819321c984f5432ceec9bea135fb73 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1518,7 +1518,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1521,7 +1521,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
throw new IllegalArgumentException("Mode cannot be null"); throw new IllegalArgumentException("Mode cannot be null");
} }

Datei anzeigen

@ -491,10 +491,10 @@ index a24e7a66d52eddbdad8db71cf5e45f1a458c389f..e1c13ac7b11fb0080435fc34502208c8
} }
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 86276267f68d68c50184343186fd8d8867b1dc3f..d79c2ce6acc9a5b1239349ad5e1438cb035a9401 100644 index 2095d844bd819321c984f5432ceec9bea135fb73..1944f812bffbe0d2b4d0a2d879acd83c0da98497 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -600,7 +600,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -603,7 +603,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
org.spigotmc.AsyncCatcher.catchOp("player kick"); // Spigot org.spigotmc.AsyncCatcher.catchOp("player kick"); // Spigot
if (this.getHandle().connection == null) return; if (this.getHandle().connection == null) return;
@ -503,7 +503,7 @@ index 86276267f68d68c50184343186fd8d8867b1dc3f..d79c2ce6acc9a5b1239349ad5e1438cb
} }
// Paper start // Paper start
@@ -612,10 +612,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -615,10 +615,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override @Override
public void kick(final net.kyori.adventure.text.Component message) { public void kick(final net.kyori.adventure.text.Component message) {

Datei anzeigen

@ -129,10 +129,10 @@ index a64cd3b54840af9a9c946b3e4e4f91d1c5f4bc97..16f23ecffa52925904d585f3fed76aa6
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index d79c2ce6acc9a5b1239349ad5e1438cb035a9401..9833e8bce6cc45fa053b71f64d71a57c1630595f 100644 index 1944f812bffbe0d2b4d0a2d879acd83c0da98497..e5a9d5862461f2458987eecf05ea9a395afe368c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1338,9 +1338,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1341,9 +1341,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override @Override
public void setBedSpawnLocation(Location location, boolean override) { public void setBedSpawnLocation(Location location, boolean override) {
if (location == null) { if (location == null) {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add player health update API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 9833e8bce6cc45fa053b71f64d71a57c1630595f..dae4efa2bceaf2d4e0ed573c9cbc49a8edda0202 100644 index e5a9d5862461f2458987eecf05ea9a395afe368c..64c2026a5b4231434bb750bdf95a7751942cd701 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2344,9 +2344,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2347,9 +2347,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().maxHealthCache = getMaxHealth(); this.getHandle().maxHealthCache = getMaxHealth();
} }
@ -22,7 +22,7 @@ index 9833e8bce6cc45fa053b71f64d71a57c1630595f..dae4efa2bceaf2d4e0ed573c9cbc49a8
if (this.getHandle().queueHealthUpdatePacket) { if (this.getHandle().queueHealthUpdatePacket) {
this.getHandle().queuedHealthUpdatePacket = packet; this.getHandle().queuedHealthUpdatePacket = packet;
} else { } else {
@@ -2355,6 +2357,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2358,6 +2360,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Paper end // Paper end
} }

Datei anzeigen

@ -25,10 +25,10 @@ index c96e75456c2f8564d3bc75993cc6e03ba605597d..7c6a6693760638a07b7c7c330aaeffd9
public void write(FriendlyByteBuf buf) { public void write(FriendlyByteBuf buf) {
buf.writeLong(this.sectionPos.asLong()); buf.writeLong(this.sectionPos.asLong());
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index c1c8b73f91655e2a3a6d4706559a31dc5f5fecc3..63f383fec691d7f6160ec3d8d675c8db0aad1bcd 100644 index 64c2026a5b4231434bb750bdf95a7751942cd701..51ddd6f0265c64241ff9d8b85959346e8106fa5e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -944,6 +944,35 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -947,6 +947,35 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().connection.send(packet); this.getHandle().connection.send(packet);
} }

Datei anzeigen

@ -74,10 +74,10 @@ index 7df1eebce5b62214943e55314e9ec98f056fa330..2aee8aacd50431c18ff28af678348ec2
// Let the server handle cross world teleports // Let the server handle cross world teleports
if (location.getWorld() != null && !location.getWorld().equals(this.getWorld())) { if (location.getWorld() != null && !location.getWorld().equals(this.getWorld())) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 21ad677121cc292bc1d1ecccb4da348829b46a46..2e36c53d5118ab37561e364b1d13c7e2ad72b4bf 100644 index 51ddd6f0265c64241ff9d8b85959346e8106fa5e..0df3bb9893d5ed22a9e9f85ebc8ef7987168923a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1231,13 +1231,100 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1234,13 +1234,100 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override @Override
public void setRotation(float yaw, float pitch) { public void setRotation(float yaw, float pitch) {
@ -179,7 +179,7 @@ index 21ad677121cc292bc1d1ecccb4da348829b46a46..2e36c53d5118ab37561e364b1d13c7e2
location.checkFinite(); location.checkFinite();
ServerPlayer entity = this.getHandle(); ServerPlayer entity = this.getHandle();
@@ -1250,7 +1337,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1253,7 +1340,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return false; return false;
} }
@ -188,7 +188,7 @@ index 21ad677121cc292bc1d1ecccb4da348829b46a46..2e36c53d5118ab37561e364b1d13c7e2
return false; return false;
} }
@@ -1268,7 +1355,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1271,7 +1358,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
// If this player is riding another entity, we must dismount before teleporting. // If this player is riding another entity, we must dismount before teleporting.
@ -197,7 +197,7 @@ index 21ad677121cc292bc1d1ecccb4da348829b46a46..2e36c53d5118ab37561e364b1d13c7e2
// SPIGOT-5509: Wakeup, similar to riding // SPIGOT-5509: Wakeup, similar to riding
if (this.isSleeping()) { if (this.isSleeping()) {
@@ -1284,13 +1371,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1287,13 +1374,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
ServerLevel toWorld = ((CraftWorld) to.getWorld()).getHandle(); ServerLevel toWorld = ((CraftWorld) to.getWorld()).getHandle();
// Close any foreign inventory // Close any foreign inventory

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Custom Chat Completion Suggestions API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index b6efec1f72b038dfdbe8f3676006d2eed864dffb..d008c33aadb658e0b71e11fb29e904af64479f60 100644 index 0df3bb9893d5ed22a9e9f85ebc8ef7987168923a..7ad4d931f6dabff1400695fcc016da2cd8f7df07 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -666,6 +666,22 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -669,6 +669,22 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().getServer().getPlayerList().sendPlayerPermissionLevel(this.getHandle(), level, false); this.getHandle().getServer().getPlayerList().sendPlayerPermissionLevel(this.getHandle(), level, false);
} }

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add custom destroyerIdentity to sendBlockDamage
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index d008c33aadb658e0b71e11fb29e904af64479f60..01978d9c56ec46669d22d363af36c1c596c318ba 100644 index 7ad4d931f6dabff1400695fcc016da2cd8f7df07..0bb3a20c1f390b14edc9286eee5d976ab7d45f44 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1029,13 +1029,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1032,13 +1032,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override @Override
public void sendBlockDamage(Location loc, float progress) { public void sendBlockDamage(Location loc, float progress) {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Elder Guardian appearance API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 82a955a5c7979090c95ed50478265b39ce89af35..3477315170312911a12ff5825522617a0c6c078c 100644 index 0bb3a20c1f390b14edc9286eee5d976ab7d45f44..2c3035da5db7374fda5c05b496728f308e53bc2f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3123,6 +3123,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3126,6 +3126,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
// Paper end // Paper end

Datei anzeigen

@ -10,10 +10,10 @@ public net.minecraft.world.entity.monster.warden.WardenSpawnTracker cooldownTick
public net.minecraft.world.entity.monster.warden.WardenSpawnTracker increaseWarningLevel()V public net.minecraft.world.entity.monster.warden.WardenSpawnTracker increaseWarningLevel()V
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 3477315170312911a12ff5825522617a0c6c078c..826fd85d946b7049e95a8e58b9e582f3958f05d4 100644 index 2c3035da5db7374fda5c05b496728f308e53bc2f..634e1b33996471e2a9dc0274f3a22cffcb0d4ff7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3128,6 +3128,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3131,6 +3131,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void showElderGuardian(boolean silent) { public void showElderGuardian(boolean silent) {
if (getHandle().connection != null) getHandle().connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.GUARDIAN_ELDER_EFFECT, silent ? 0F : 1F)); if (getHandle().connection != null) getHandle().connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.GUARDIAN_ELDER_EFFECT, silent ? 0F : 1F));
} }

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] fix Instruments
properly handle Player#playNote properly handle Player#playNote
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 7944f6a130da8f370f8018fad495694c61a94338..c3c4bc73310993f3a92d8aa171289fc61da8949f 100644 index 634e1b33996471e2a9dc0274f3a22cffcb0d4ff7..18357352824fdd6604c450b759646134a3a42074 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -768,62 +768,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -771,62 +771,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void playNote(Location loc, Instrument instrument, Note note) { public void playNote(Location loc, Instrument instrument, Note note) {
if (this.getHandle().connection == null) return; if (this.getHandle().connection == null) return;

Datei anzeigen

@ -26,10 +26,10 @@ index 5b772b3caeafe98aa45a01bffe215a5dd33323b6..0629c471d38a77c44fc1c86ccdfcb069
} else { } else {
if (fallDistance >= 2.0F) { if (fallDistance >= 2.0F) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 63f8a92cadfecc2d0e5256c5de822fe86d5ed91b..cdb1e5d82ff1e18e3f27c816df57bd9eeebbe80b 100644 index 18357352824fdd6604c450b759646134a3a42074..a13b0db44fca0b9c3b08687a3058fc953aa5e4e2 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2291,6 +2291,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2294,6 +2294,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().onUpdateAbilities(); this.getHandle().onUpdateAbilities();
} }

Datei anzeigen

@ -10,7 +10,7 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/
index cdb1e5d82ff1e18e3f27c816df57bd9eeebbe80b..0ae1fce0c1a2e3bfbbab756a088fc76545e263fa 100644 index cdb1e5d82ff1e18e3f27c816df57bd9eeebbe80b..0ae1fce0c1a2e3bfbbab756a088fc76545e263fa 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1208,6 +1208,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1211,6 +1211,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().connection.send(packet); this.getHandle().connection.send(packet);
} }