[SPIGOT-6069] ItemStack.getData() and ItemStack.setData(...) cause legacy material init Created: 13/Aug/20 Updated: 13/Aug/20 Resolved: 13/Aug/20 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Minor |
Reporter: | Oscar | Assignee: | Unassigned |
Resolution: | Won't Fix | Votes: | 0 |
Labels: | 1.13, bukkit | ||
Environment: |
Affects Minecraft versions 1.13+ |
Version: | git-Paper-135 (MC: 1.16.1) |
Guidelines Read: | Yes |
Description |
Calling ItemStack.getData() or ItemStack.setData(...) causes legacy material support initialization{{}}: Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug! The server freezes for a second while it does some legacy material magic before returning a legacy material (e.g. LEGACY_DIRT, instead of{{ DIRT}}). The documentation does not mention this behavior. As I feel we all would prefer to work with new, better DIRT over old, horrible LEGACY_DIRT, I think the method should be annotated as deprecated and/or the documentation should be updated to make users aware of this (misleading) behavior. One of the methods in question looks like so: /** return data;
|
Comments |
Comment by md_5 [ 13/Aug/20 ] |
MaterialData itself is marked deprecated. It's a bit hard to manually deprecate every method referring to it |