Skip to content

Commit

Permalink
Use forRemoval further, and add the extra suppressions necessary due …
Browse files Browse the repository at this point in the history
…to this
  • Loading branch information
me4502 committed Apr 24, 2024
1 parent 396d93a commit 0c91194
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 11 deletions.
Expand Up @@ -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) {
Expand Down
Expand Up @@ -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();
Expand Down
Expand Up @@ -49,7 +49,7 @@
*
* @deprecated Deprecated without replacement.
*/
@Deprecated
@Deprecated(forRemoval = true)
public final class BundledItemData {

private static final Logger LOGGER = LogManagerCompat.getLogger();
Expand Down Expand Up @@ -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);
Expand Down
Expand Up @@ -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")) {
Expand All @@ -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) {
Expand All @@ -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()));
Expand Down
Expand Up @@ -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();
Expand Down
Expand Up @@ -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
Expand Down
Expand Up @@ -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
Expand Down
Expand Up @@ -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
Expand Down

0 comments on commit 0c91194

Please sign in to comment.