Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions verification/src/changes/accepted-core-public-api-changes.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,38 @@
"METHOD_REMOVED",
"ANNOTATION_REMOVED"
]
},
{
"type": "com.sk89q.worldedit.world.block.BlockType",
"member": "Method com.sk89q.worldedit.world.block.BlockType.getName()",
"changes": [
"METHOD_REMOVED",
"ANNOTATION_REMOVED"
]
},
{
"type": "com.sk89q.worldedit.world.item.ItemType",
"member": "Method com.sk89q.worldedit.world.item.ItemType.getName()",
"changes": [
"METHOD_REMOVED",
"ANNOTATION_REMOVED"
]
},
{
"type": "com.sk89q.worldedit.world.registry.BlockRegistry",
"member": "Method com.sk89q.worldedit.world.registry.BlockRegistry.getName(com.sk89q.worldedit.world.block.BlockType)",
"changes": [
"METHOD_REMOVED",
"ANNOTATION_REMOVED"
]
},
{
"type": "com.sk89q.worldedit.world.registry.ItemRegistry",
"member": "Method com.sk89q.worldedit.world.registry.ItemRegistry.getName(com.sk89q.worldedit.world.item.ItemType)",
"changes": [
"METHOD_REMOVED",
"ANNOTATION_REMOVED"
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ public class BlockType implements Keyed {
= LazyReference.from(() -> WorldEdit.getInstance().getPlatformManager()
.queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().getMaterial(this));
@SuppressWarnings("this-escape")
@Deprecated
private final LazyReference<String> name = LazyReference.from(() -> WorldEdit.getInstance().getPlatformManager()
.queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().getName(this));
@SuppressWarnings("this-escape")
private final LazyReference<Integer> legacyId = LazyReference.from(() -> computeLegacy(0));
@SuppressWarnings("this-escape")
private final LazyReference<Integer> legacyData = LazyReference.from(() -> computeLegacy(1));
Expand Down Expand Up @@ -123,21 +119,6 @@ public Component getRichName() {
.getRegistries().getBlockRegistry().getRichName(this);
}

/**
* Gets the name of this block, or the ID if the name cannot be found.
*
* @return The name, or ID
* @deprecated The name is now translatable, use {@link #getRichName()}.
*/
@Deprecated
public String getName() {
String name = this.name.getValue();
if (name == null || name.isEmpty()) {
return id();
}
return name;
}

/**
* Gets the properties of this BlockType in a {@code key->property} mapping.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.sk89q.worldedit.extension.platform.Capability;
import com.sk89q.worldedit.registry.Keyed;
import com.sk89q.worldedit.registry.NamespacedRegistry;
import com.sk89q.worldedit.util.GuavaUtil;
import com.sk89q.worldedit.util.concurrency.LazyReference;
import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.world.block.BlockType;
Expand All @@ -37,15 +36,6 @@ public class ItemType implements Keyed {
public static final NamespacedRegistry<ItemType> REGISTRY = new NamespacedRegistry<>("item type", "item_type", "minecraft", true);

private final String id;
@SuppressWarnings({"deprecation", "this-escape"})
private final LazyReference<String> name = LazyReference.from(() -> {
String name = GuavaUtil.firstNonNull(
WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS)
.getRegistries().getItemRegistry().getName(this),
""
);
return name.isEmpty() ? id() : name;
});
@SuppressWarnings("this-escape")
private final LazyReference<Component> richName = LazyReference.from(() ->
WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS)
Expand Down Expand Up @@ -74,18 +64,6 @@ public Component getRichName() {
return richName.getValue();
}

/**
* Gets the name of this item, or the ID if the name cannot be found.
*
* @return The name, or ID
* @deprecated Names are translatable now, use {@link #getRichName()}.
*/
@Deprecated
public String getName() {
return name.getValue();
}


/**
* Gets whether this item type has a block representation.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,6 @@ public interface BlockRegistry {
*/
Component getRichName(BlockType blockType);

/**
* Gets the name for the given block.
*
* @param blockType the block
* @return The name, or null if it's unknown
* @deprecated Names are now translatable, use {@link #getRichName(BlockType)}.
*/
@Deprecated
@Nullable
default String getName(BlockType blockType) {
return getRichName(blockType).toString();
}

/**
* Get the material for the given block.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,6 @@ public Component getRichName(BlockType blockType) {
);
}

@Nullable
@Override
@Deprecated
// dumb_intellij.jpg
@SuppressWarnings("deprecation")
public String getName(BlockType blockType) {
BundledBlockData.BlockEntry blockEntry = BundledBlockData.getInstance().findById(blockType.id());
return blockEntry != null ? blockEntry.localizedName : null;
}

@Nullable
@Override
public BlockMaterial getMaterial(BlockType blockType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,6 @@ public Component getRichName(ItemType itemType) {
);
}

@Nullable
@Override
@Deprecated
// dumb_intellij.jpg
@SuppressWarnings({"deprecation", "removal"})
public String getName(ItemType itemType) {
BundledItemData.ItemEntry itemEntry = getEntryById(itemType);
if (itemEntry != null) {
String localized = itemEntry.localizedName;
if (localized.equals("Air")) {
String id = itemType.id();
int c = id.indexOf(':');
return c < 0 ? id : id.substring(c + 1);
}
return localized;
}
return null;
}

@Nullable
@Override
@Deprecated(forRemoval = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,6 @@ default Component getRichName(BaseItemStack itemStack) {
return getRichName(itemStack.getType());
}

/**
* Gets the name for the given item.
*
* @param itemType the item
* @return The name, or null if it's unknown
* @deprecated Names are now translatable, use {@link #getRichName(ItemType)}.
*/
@Deprecated
@Nullable
default String getName(ItemType itemType) {
return getRichName(itemType).toString();
}

/**
* Get the material for the given item.
*
Expand Down
Loading