3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 02:50:09 +01:00

Removes some references to deprecated methods/types (#9043)

Dieser Commit ist enthalten in:
Jake Potrebic 2023-04-15 18:13:59 -07:00 committet von GitHub
Ursprung 23a443eeaa
Commit 6d2121efde
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
7 geänderte Dateien mit 71 neuen und 15 gelöschten Zeilen

Datei anzeigen

@ -3219,7 +3219,7 @@ index 2f6ca42330675733b2b4132cbb66e433788d05d5..997b06c19a5277656521e0e298f2958c
@NotNull
diff --git a/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java b/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java
index 36b436e145a7215682b692a87ab894df25752c1d..ebd499c1a2d11ea068e8c374edbc3967e4cece3d 100644
index 36b436e145a7215682b692a87ab894df25752c1d..c5e8bffef736365881953161ff812c98adf93a80 100644
--- a/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java
@@ -12,17 +12,31 @@ public class PlayerLocaleChangeEvent extends PlayerEvent {
@ -3229,7 +3229,7 @@ index 36b436e145a7215682b692a87ab894df25752c1d..ebd499c1a2d11ea068e8c374edbc3967
+ // Paper start
+ private final java.util.Locale adventure$locale;
+ /**
+ * @see Player#getLocale()
+ * @see Player#locale()
+ *
+ * @return the player's new locale
+ */
@ -3552,10 +3552,21 @@ index d70c25f404e994766a9ebce89a917c8d0719777c..14b27eaaf744736b3e56bb1383481df9
@NotNull
diff --git a/src/main/java/org/bukkit/event/server/BroadcastMessageEvent.java b/src/main/java/org/bukkit/event/server/BroadcastMessageEvent.java
index 03bfca9d368bbe4b7c1353d52c883e756bf69bda..1bfd8ba2a9fa16f2084ad36515644f6af79fdced 100644
index 03bfca9d368bbe4b7c1353d52c883e756bf69bda..25c0fe98489d903fdf77cbdd181c95593bd7f727 100644
--- a/src/main/java/org/bukkit/event/server/BroadcastMessageEvent.java
+++ b/src/main/java/org/bukkit/event/server/BroadcastMessageEvent.java
@@ -18,7 +18,7 @@ import org.jetbrains.annotations.NotNull;
@@ -9,16 +9,16 @@ import org.jetbrains.annotations.NotNull;
/**
* Event triggered for server broadcast messages such as from
- * {@link org.bukkit.Server#broadcast(String, String)}.
+ * {@link org.bukkit.Server#broadcast(net.kyori.adventure.text.Component)} (String, String)}.
*
- * <b>This event behaves similarly to {@link AsyncPlayerChatEvent} in that it
+ * <b>This event behaves similarly to {@link io.papermc.paper.event.player.AsyncChatEvent} in that it
* should be async if fired from an async thread. Please see that event for
* further information.</b>
*/
public class BroadcastMessageEvent extends ServerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();

Datei anzeigen

@ -1362,6 +1362,18 @@ index e195e74c48c69047aa825b75fad95419c505b41f..53f28c9e6843991486a576d41b6641c1
register("bukkit", new TimingsCommand("timings"));
}
diff --git a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
index bcb576a4271b1ec7b1cfe6f83cf161b7d89ed2e5..4d849e1283fdf6b0872a0f2183964cc93748c116 100644
--- a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
@@ -9,6 +9,7 @@ import org.bukkit.command.CommandSender;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;
+@Deprecated(forRemoval = true) // Paper
public class PluginsCommand extends BukkitCommand {
public PluginsCommand(@NotNull String name) {
super(name);
diff --git a/src/main/java/org/bukkit/plugin/Plugin.java b/src/main/java/org/bukkit/plugin/Plugin.java
index b37938745f916b5f0111b07b1a1c97527f026e9d..8c76716249e44ed8bf6be94c1f5c7b6d9bb35be2 100644
--- a/src/main/java/org/bukkit/plugin/Plugin.java
@ -1850,7 +1862,7 @@ index a80251eff75430863b37db1c131e22593f3fcd5e..310c4041963a3f1e0a26e39a6da12a9b
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
index 669a70faa95d0d6525a731d73499ed6fb0b48320..c9cf9d361a1289aba383718733a2098b5eafb38f 100644
index 669a70faa95d0d6525a731d73499ed6fb0b48320..85619f03461a095b5cdb441da8994b1ea02de5f0 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
@@ -38,6 +38,7 @@ public abstract class JavaPlugin extends PluginBase {
@ -1908,7 +1920,7 @@ index 669a70faa95d0d6525a731d73499ed6fb0b48320..c9cf9d361a1289aba383718733a2098b
return description;
}
+ @Nullable
+ @NotNull
+ public final io.papermc.paper.plugin.configuration.PluginMeta getPluginMeta() {
+ return this.pluginMeta;
+ }

Datei anzeigen

@ -243,6 +243,19 @@ index f9bd74f9ce6bd6650726e5a993f9b6e292cdc74d..f4c37ce1fe7aac3dde8485ee51fc8888
+ void setColor(@org.bukkit.UndefinedNullability("not supported") org.bukkit.DyeColor color);
+// Paper end
+}
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
index f8e12868f2e629cdf4784f0157fdb2f8e7b01f99..870ad6cd930653e6248abcc0fce94ffafbe9ebde 100644
--- a/src/main/java/org/bukkit/block/Block.java
+++ b/src/main/java/org/bukkit/block/Block.java
@@ -357,7 +357,7 @@ public interface Block extends Metadatable, Translatable {
* Gets the temperature of this block.
* <p>
* If the raw biome temperature without adjusting for height effects is
- * required then please use {@link World#getTemperature(int, int)}.
+ * required then please use {@link World#getTemperature(int, int, int)}.
*
* @return Temperature of this block
*/
diff --git a/src/main/java/org/bukkit/block/data/BlockData.java b/src/main/java/org/bukkit/block/data/BlockData.java
index 96dbcc34c87dc3713ece696e8bf65d264faf0236..dd4f394860ef8cabbd4174fe3088eec97aec73a5 100644
--- a/src/main/java/org/bukkit/block/data/BlockData.java
@ -734,6 +747,22 @@ index 6782024735a885ba0b1b4dba4a576740c1410366..8977f7609431c3c46324a82de84d4a32
@NotNull
@Override
public HandlerList getHandlers() {
diff --git a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
index 4c2102a11c3d682d98f0db4ccafa35231e66bcdd..ca238af544764273b9cd4cf3587e8632031c9ede 100644
--- a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
@@ -5,8 +5,9 @@ import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
/**
- * Called when a player takes action on a resource pack request sent via
- * {@link Player#setResourcePack(java.lang.String)}.
+ * Called when a player takes action on a resource pack request.
+ * @see Player#setResourcePack(String, String)
+ * @see Player#setResourcePack(String, String, boolean)
*/
public class PlayerResourcePackStatusEvent extends PlayerEvent {
diff --git a/src/main/java/org/bukkit/generator/ChunkGenerator.java b/src/main/java/org/bukkit/generator/ChunkGenerator.java
index 0cc6e29a5af28e95f87f415d6b2424d4622a6f34..c0b749a5bbf4980d01fed74768bb61909b579cb9 100644
--- a/src/main/java/org/bukkit/generator/ChunkGenerator.java

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Create HoverEvent from ItemStack Entity
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index 50fe28b48d885c782278bdb53a0bbae303f4a32d..34c13845f4916fb167fc9d83fe792975e5c52bdc 100644
index 50fe28b48d885c782278bdb53a0bbae303f4a32d..af36ee37290f04a629c1d6471f2a99a8bf437132 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -204,5 +204,62 @@ public interface ItemFactory {
@@ -204,5 +204,64 @@ public interface ItemFactory {
*/
@NotNull
ItemStack ensureServerConversions(@NotNull ItemStack item);
@ -16,10 +16,12 @@ index 50fe28b48d885c782278bdb53a0bbae303f4a32d..34c13845f4916fb167fc9d83fe792975
+ /**
+ * Creates a {@link net.md_5.bungee.api.chat.hover.content.Content} of that ItemStack for displaying.
+ *
+ * @param itemStack
+ * @param itemStack the itemstack
+ * @return the {@link net.md_5.bungee.api.chat.hover.content.Content} of that ItemStack
+ * @deprecated use {@link ItemStack#asHoverEvent()}
+ */
+ @NotNull
+ @Deprecated // Paper
+ net.md_5.bungee.api.chat.hover.content.Content hoverContentOf(@NotNull ItemStack itemStack);
+
+ /**

Datei anzeigen

@ -170,10 +170,10 @@ index 0000000000000000000000000000000000000000..0c83a02059d65672ff191c42932d8509
+}
diff --git a/src/main/java/io/papermc/paper/event/world/StructuresLocateEvent.java b/src/main/java/io/papermc/paper/event/world/StructuresLocateEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..1648ed317145eb73c0cca431823449b2adc43e04
index 0000000000000000000000000000000000000000..4342b162f69b6509503e9772ddd2c5ac6659545a
--- /dev/null
+++ b/src/main/java/io/papermc/paper/event/world/StructuresLocateEvent.java
@@ -0,0 +1,208 @@
@@ -0,0 +1,210 @@
+package io.papermc.paper.event.world;
+
+import io.papermc.paper.math.Position;
@ -188,6 +188,7 @@ index 0000000000000000000000000000000000000000..1648ed317145eb73c0cca431823449b2
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.world.WorldEvent;
+import org.bukkit.generator.structure.Structure;
+import org.bukkit.generator.structure.StructureType;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.UnmodifiableView;
@ -201,7 +202,8 @@ index 0000000000000000000000000000000000000000..1648ed317145eb73c0cca431823449b2
+ * <li>An Explorer/Treasure Map is activated.</li>
+ * <li>A dolphin swims to a treasure location.</li>
+ * <li>A trade is done with a villager for a map.</li>
+ * <li>{@link World#locateNearestStructure(Location, org.bukkit.StructureType, int, boolean)} is invoked.</li>
+ * <li>{@link World#locateNearestStructure(Location, StructureType, int, boolean)} is invoked.</li>
+ * <li>{@link World#locateNearestStructure(Location, Structure, int, boolean)} is invoked.</li>
+ * </ul>
+ */
+public class StructuresLocateEvent extends WorldEvent implements Cancellable {

Datei anzeigen

@ -8,7 +8,7 @@ diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java
index fea728e9c4aaab792e6a6b4a71c1e9c34096d305..bed2278dbd35be9bdc82e7fcfaf077fdf040edd0 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -261,5 +261,14 @@ public interface ItemFactory {
@@ -263,5 +263,14 @@ public interface ItemFactory {
@NotNull
@Deprecated
net.md_5.bungee.api.chat.hover.content.Content hoverContentOf(@NotNull org.bukkit.entity.Entity entity, @NotNull net.md_5.bungee.api.chat.BaseComponent[] customName);

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Warn on strange @EventHandler return types
diff --git a/src/main/java/org/bukkit/plugin/EventExecutor.java b/src/main/java/org/bukkit/plugin/EventExecutor.java
index 9026e108ccd3a88aee1267ee275137befa646455..e1860322ae0f3c35097d16767628744034941749 100644
index 9026e108ccd3a88aee1267ee275137befa646455..5fa52419f21d8e8b3d8f9aafd248b05774a28348 100644
--- a/src/main/java/org/bukkit/plugin/EventExecutor.java
+++ b/src/main/java/org/bukkit/plugin/EventExecutor.java
@@ -51,6 +51,12 @@ public interface EventExecutor {
@ -16,7 +16,7 @@ index 9026e108ccd3a88aee1267ee275137befa646455..e1860322ae0f3c35097d167676287440
+ final org.bukkit.plugin.java.JavaPlugin plugin = org.bukkit.plugin.java.JavaPlugin.getProvidingPlugin(m.getDeclaringClass());
+ org.bukkit.Bukkit.getLogger().warning("@EventHandler method " + m.getDeclaringClass().getName() + (Modifier.isStatic(m.getModifiers()) ? '.' : '#') + m.getName()
+ + " returns non-void type " + m.getReturnType().getName() + ". This is unsupported behavior and will no longer work in a future version of Paper."
+ + " This should be reported to the developers of " + plugin.getDescription().getFullName() + " (" + String.join(",", plugin.getDescription().getAuthors()) + ')');
+ + " This should be reported to the developers of " + plugin.getPluginMeta().getDisplayName() + " (" + String.join(",", plugin.getPluginMeta().getAuthors()) + ')');
+ }
if (Modifier.isStatic(m.getModifiers())) {
return new StaticMethodHandleEventExecutor(eventClass, m);