Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PotionMeta#hasCustomName compatability #11732

Open
tal5 opened this issue Dec 12, 2024 · 0 comments
Open

PotionMeta#hasCustomName compatability #11732

tal5 opened this issue Dec 12, 2024 · 0 comments
Labels
status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. version: 1.21.4

Comments

@tal5
Copy link
Contributor

tal5 commented Dec 12, 2024

Expected behavior

For PotionMeta#hasCustomName to return whether the PotionMeta has a custom name.

Observed/Actual behavior

PotionMeta#hasCustomName seems to call ItemMeta#hasCustomName instead of the PotionMeta deprecated redirect, I assume because the override in CraftMetaItem takes priority?

Steps/models to reproduce

Wrote a test plugin:

ItemStack item = player.getEquipment().getItemInMainHand();
PotionMeta meta = (PotionMeta) item.getItemMeta();
player.sendMessage(meta.hasCustomName() + "|||||" + meta.getCustomName());
try {
    player.sendMessage(meta.getClass().getMethod("hasCustomName").toString());
}
catch (NoSuchMethodException e) {
    throw new RuntimeException(e);
}
return true;

On latest Spigot:
Image
On latest Paper:
Image
Item used: /give @s minecraft:potion[minecraft:potion_contents={custom_name:"shadow_walk"}]

Plugin and Datapack List

> plugins
[21:39:16 INFO]: Server Plugins (2):
[21:39:16 INFO]: Bukkit Plugins:
[21:39:16 INFO]:  - Debuggery, SpigotTestPlugin
> datapack list
[21:40:00 INFO]: There are 3 data pack(s) enabled: [vanilla (built-in)], [file/bukkit (world)], [paper (built-in)]
[21:40:00 INFO]: There are no more data packs available

Paper version

> version
[21:40:31 INFO]: Checking version, please wait...
[21:40:31 INFO]: This server is running Paper version 1.21.4-14-master@b746d9d (2024-12-11T21:22:39Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21.3-36-d8b66dd (MC: 1.21.3)

Other

No response

@lynxplay lynxplay added status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. and removed status: needs triage labels Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. version: 1.21.4
Projects
None yet
Development

No branches or pull requests

2 participants