Deprecated wrong method

This commit is contained in:
Chaosdave34 2024-12-23 13:24:01 +01:00
parent d22f503f73
commit 57b24f3cf6
2 changed files with 34 additions and 18 deletions

View file

@ -33,11 +33,22 @@ import org.jetbrains.annotations.Nullable;
public interface UnsafeValues {
// Paper start
net.kyori.adventure.text.flattener.ComponentFlattener componentFlattener();
@Deprecated(forRemoval = true) net.kyori.adventure.text.serializer.plain.PlainComponentSerializer plainComponentSerializer();
@Deprecated(forRemoval = true) net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer plainTextSerializer();
@Deprecated(forRemoval = true) net.kyori.adventure.text.serializer.gson.GsonComponentSerializer gsonComponentSerializer();
@Deprecated(forRemoval = true) net.kyori.adventure.text.serializer.gson.GsonComponentSerializer colorDownsamplingGsonComponentSerializer();
@Deprecated(forRemoval = true) net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer legacyComponentSerializer();
@Deprecated(forRemoval = true)
net.kyori.adventure.text.serializer.plain.PlainComponentSerializer plainComponentSerializer();
@Deprecated(forRemoval = true)
net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer plainTextSerializer();
@Deprecated(forRemoval = true)
net.kyori.adventure.text.serializer.gson.GsonComponentSerializer gsonComponentSerializer();
@Deprecated(forRemoval = true)
net.kyori.adventure.text.serializer.gson.GsonComponentSerializer colorDownsamplingGsonComponentSerializer();
@Deprecated(forRemoval = true)
net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer legacyComponentSerializer();
net.kyori.adventure.text.Component resolveWithContext(net.kyori.adventure.text.Component component, org.bukkit.command.CommandSender context, org.bukkit.entity.Entity scoreboardSubject, boolean bypassPermissions) throws java.io.IOException;
// Paper end
@ -73,7 +84,7 @@ public interface UnsafeValues {
* <br>
* Callers should be prepared for {@link Exception} to be thrown.
*
* @param key the unique advancement key
* @param key the unique advancement key
* @param advancement representation of the advancement
* @return the loaded advancement or null if an error occurred
*/
@ -125,6 +136,7 @@ public interface UnsafeValues {
@ApiStatus.Internal
@Nullable
@Deprecated// Paper
DamageEffect getDamageEffect(@NotNull String key);
/**
@ -157,6 +169,7 @@ public interface UnsafeValues {
// Paper end
// Paper start
/**
* Called once by the version command on first use, then cached.
*/
@ -177,8 +190,8 @@ public interface UnsafeValues {
* non-development purposes like plugin configurations or end-user input.
*
* @return json object representing this item.
* @see #deserializeItemFromJson(com.google.gson.JsonObject)
* @throws IllegalArgumentException if the passed itemstack is {@link ItemStack#empty()}.
* @see #deserializeItemFromJson(com.google.gson.JsonObject)
*/
@NotNull
com.google.gson.JsonObject serializeItemAsJson(@NotNull ItemStack itemStack);
@ -230,7 +243,7 @@ public interface UnsafeValues {
* Returns false if either argument's type is not an item ({@link Material#isItem()}).
*
* @param itemToBeRepaired the itemstack to be repaired
* @param repairMaterial the repair material
* @param repairMaterial the repair material
* @return true if valid repair, false if not
*/
public boolean isValidRepairItemStack(@org.jetbrains.annotations.NotNull ItemStack itemToBeRepaired, @org.jetbrains.annotations.NotNull ItemStack repairMaterial);
@ -263,15 +276,16 @@ public interface UnsafeValues {
// Paper end
// Paper start - namespaced key biome methods
/**
* Gets the {@link NamespacedKey} for the biome at the given location.
*
* @param accessor The {@link RegionAccessor} of the provided coordinates
* @param x X-coordinate of the block
* @param y Y-coordinate of the block
* @param z Z-coordinate of the block
* @deprecated custom biomes are properly supported in API now
* @param x X-coordinate of the block
* @param y Y-coordinate of the block
* @param z Z-coordinate of the block
* @return the biome's {@link NamespacedKey}
* @deprecated custom biomes are properly supported in API now
*/
@org.jetbrains.annotations.NotNull
@Deprecated(since = "1.21.3", forRemoval = true)
@ -284,12 +298,12 @@ public interface UnsafeValues {
* will be thrown.
*
* @param accessor The {@link RegionAccessor} of the provided coordinates
* @param x X-coordinate of the block
* @param y Y-coordinate of the block
* @param z Z-coordinate of the block
* @param x X-coordinate of the block
* @param y Y-coordinate of the block
* @param z Z-coordinate of the block
* @param biomeKey Biome key
* @deprecated custom biomes are properly supported in API now
* @throws IllegalStateException if no biome by the given key is registered.
* @deprecated custom biomes are properly supported in API now
*/
@Deprecated(since = "1.21.3", forRemoval = true)
void setBiomeKey(RegionAccessor accessor, int x, int y, int z, NamespacedKey biomeKey);
@ -298,19 +312,22 @@ public interface UnsafeValues {
String getStatisticCriteriaKey(@NotNull org.bukkit.Statistic statistic); // Paper - fix custom stats criteria creation
// Paper start - spawn egg color visibility
/**
* Obtains the underlying color informating for a spawn egg of a given
* entity type, or null if the entity passed does not have a spawn egg.
* Spawn eggs have two colors - the background layer (0), and the
* foreground layer (1)
*
* @param entityType The entity type to get the color for
* @param layer The texture layer to get a color for
* @param layer The texture layer to get a color for
* @return The color of the layer for the entity's spawn egg
*/
@Nullable org.bukkit.Color getSpawnEggLayerColor(org.bukkit.entity.EntityType entityType, int layer);
// Paper end - spawn egg color visibility
// Paper start - lifecycle event API
/**
* @hidden
*/

View file

@ -467,7 +467,6 @@ public final class CraftMagicNumbers implements UnsafeValues {
}
@Override
@Deprecated // Paper
public DamageEffect getDamageEffect(String key) {
Preconditions.checkArgument(key != null, "key cannot be null");
return CraftDamageEffect.getById(key);