Paper
Paper copied to clipboard
`PotionMeta#hasCustomName` compatability
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:
On latest Paper:
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