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

This commit is contained in:
Jake Potrebic 2023-04-15 18:13:59 -07:00
parent 01df66a280
commit 77aec31991
6 changed files with 61 additions and 5 deletions

View file

@ -188,6 +188,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+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..00000000000000000000000000000000
+ * <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 {

View file

@ -3229,7 +3229,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start
+ private final java.util.Locale adventure$locale;
+ /**
+ * @see Player#getLocale()
+ * @see Player#locale()
+ *
+ * @return the player's new locale
+ */
@ -3556,6 +3556,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/event/server/BroadcastMessageEvent.java
+++ b/src/main/java/org/bukkit/event/server/BroadcastMessageEvent.java
@@ -0,0 +0,0 @@ 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();

View file

@ -16,10 +16,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ /**
+ * 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);
+
+ /**

View file

@ -243,6 +243,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/block/Block.java
+++ b/src/main/java/org/bukkit/block/Block.java
@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/block/data/BlockData.java
@ -734,6 +747,22 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/generator/ChunkGenerator.java

View file

@ -1362,6 +1362,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/plugin/Plugin.java
@ -1908,7 +1920,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return description;
}
+ @Nullable
+ @NotNull
+ public final io.papermc.paper.plugin.configuration.PluginMeta getPluginMeta() {
+ return this.pluginMeta;
+ }

View file

@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ 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);