From 0c9119456bfd3c7f99a77ac556d3564b5a87a48f Mon Sep 17 00:00:00 2001 From: Madeline Miller Date: Wed, 24 Apr 2024 21:34:42 +1000 Subject: [PATCH] Use forRemoval further, and add the extra suppressions necessary due to this --- .../com/sk89q/worldedit/bukkit/BukkitItemRegistry.java | 2 +- .../java/com/sk89q/worldedit/world/item/ItemType.java | 2 +- .../sk89q/worldedit/world/registry/BundledItemData.java | 4 ++-- .../worldedit/world/registry/BundledItemRegistry.java | 8 +++++--- .../sk89q/worldedit/world/registry/BundledRegistries.java | 2 +- .../com/sk89q/worldedit/fabric/FabricItemRegistry.java | 2 +- .../java/com/sk89q/worldedit/forge/ForgeItemRegistry.java | 2 +- .../com/sk89q/worldedit/sponge/SpongeItemRegistry.java | 2 +- 8 files changed, 13 insertions(+), 11 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitItemRegistry.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitItemRegistry.java index 462b5a4c83..c1cee9182d 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitItemRegistry.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitItemRegistry.java @@ -24,7 +24,7 @@ import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.registry.BundledItemRegistry; -@SuppressWarnings("deprecation") +@SuppressWarnings("removal") class BukkitItemRegistry extends BundledItemRegistry { @Override public Component getRichName(ItemType itemType) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java index 1536f9f291..81e00df923 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java @@ -110,7 +110,7 @@ public BlockType getBlockType() { * @return The material * @deprecated Deprecated without alternative */ - @Deprecated + @Deprecated(forRemoval = true) @SuppressWarnings("removal") public ItemMaterial getMaterial() { return itemMaterial.getValue(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java index 21f7eea6e3..55a96f3f42 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java @@ -49,7 +49,7 @@ * * @deprecated Deprecated without replacement. */ -@Deprecated +@Deprecated(forRemoval = true) public final class BundledItemData { private static final Logger LOGGER = LogManagerCompat.getLogger(); @@ -111,7 +111,7 @@ public ItemEntry findById(String id) { * @deprecated Deprecated without alternative */ @Nullable - @Deprecated + @Deprecated(forRemoval = true) @SuppressWarnings("removal") public ItemMaterial getMaterialById(String id) { ItemEntry entry = findById(id); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java index a2889c8eee..cd5147117e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java @@ -33,14 +33,16 @@ * * @deprecated Use the platform Item Registries */ -@Deprecated +@Deprecated(forRemoval = true) public class BundledItemRegistry implements ItemRegistry { + @SuppressWarnings("removal") private BundledItemData.ItemEntry getEntryById(ItemType itemType) { return BundledItemData.getInstance().findById(itemType.id()); } @Override + @SuppressWarnings("removal") public Component getRichName(ItemType itemType) { BundledItemData.ItemEntry itemEntry = getEntryById(itemType); if (itemEntry != null && !itemEntry.localizedName.equals("Air")) { @@ -59,7 +61,7 @@ public Component getRichName(ItemType itemType) { @Override @Deprecated // dumb_intellij.jpg - @SuppressWarnings("deprecation") + @SuppressWarnings({"deprecation", "removal"}) public String getName(ItemType itemType) { BundledItemData.ItemEntry itemEntry = getEntryById(itemType); if (itemEntry != null) { @@ -76,7 +78,7 @@ public String getName(ItemType itemType) { @Nullable @Override - @Deprecated + @Deprecated(forRemoval = true) @SuppressWarnings("removal") public ItemMaterial getMaterial(ItemType itemType) { return new PassthroughItemMaterial(BundledItemData.getInstance().getMaterialById(itemType.id())); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledRegistries.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledRegistries.java index 518978e384..5d4fa5d259 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledRegistries.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledRegistries.java @@ -70,7 +70,7 @@ static URL loadRegistry(String name) throws IOException { } private final BundledBlockRegistry blockRegistry = new BundledBlockRegistry(); - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") private final BundledItemRegistry itemRegistry = new BundledItemRegistry(); private final NullEntityRegistry entityRegistry = new NullEntityRegistry(); private final NullBiomeRegistry biomeRegistry = new NullBiomeRegistry(); diff --git a/worldedit-fabric/src/main/java/com/sk89q/worldedit/fabric/FabricItemRegistry.java b/worldedit-fabric/src/main/java/com/sk89q/worldedit/fabric/FabricItemRegistry.java index 5abe115fba..e298ce3a7b 100644 --- a/worldedit-fabric/src/main/java/com/sk89q/worldedit/fabric/FabricItemRegistry.java +++ b/worldedit-fabric/src/main/java/com/sk89q/worldedit/fabric/FabricItemRegistry.java @@ -25,7 +25,7 @@ import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.registry.BundledItemRegistry; -@SuppressWarnings("deprecation") +@SuppressWarnings("removal") public class FabricItemRegistry extends BundledItemRegistry { @Override diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java index 9545f5323b..0753e794de 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java @@ -25,7 +25,7 @@ import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.registry.BundledItemRegistry; -@SuppressWarnings("deprecation") +@SuppressWarnings("removal") public class ForgeItemRegistry extends BundledItemRegistry { @Override diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeItemRegistry.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeItemRegistry.java index b57be8d4a0..c4936eed97 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeItemRegistry.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeItemRegistry.java @@ -29,7 +29,7 @@ import org.spongepowered.api.Sponge; import org.spongepowered.api.registry.RegistryTypes; -@SuppressWarnings("deprecation") +@SuppressWarnings("removal") public class SpongeItemRegistry extends BundledItemRegistry { @Override