mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 11:44:19 +01:00
SPIGOT-4253: Add way to prioritise item conversion
By: md_5 <git@md-5.net>
This commit is contained in:
parent
823697c6e3
commit
d80abc45fc
2 changed files with 3 additions and 1 deletions
|
@ -23,6 +23,8 @@ public interface UnsafeValues {
|
||||||
|
|
||||||
Material fromLegacy(MaterialData material);
|
Material fromLegacy(MaterialData material);
|
||||||
|
|
||||||
|
Material fromLegacy(MaterialData material, boolean itemPriority);
|
||||||
|
|
||||||
BlockData fromLegacy(Material material, byte data);
|
BlockData fromLegacy(Material material, byte data);
|
||||||
|
|
||||||
int getDataVersion();
|
int getDataVersion();
|
||||||
|
|
|
@ -451,7 +451,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
|
||||||
type = Material.getMaterial(Material.LEGACY_PREFIX + (String) args.get("type"));
|
type = Material.getMaterial(Material.LEGACY_PREFIX + (String) args.get("type"));
|
||||||
|
|
||||||
byte dataVal = (type.getMaxDurability() == 0) ? (byte) damage : 0; // Actually durable items get a 0 passed into conversion
|
byte dataVal = (type.getMaxDurability() == 0) ? (byte) damage : 0; // Actually durable items get a 0 passed into conversion
|
||||||
type = Bukkit.getUnsafe().fromLegacy(new MaterialData(type, dataVal));
|
type = Bukkit.getUnsafe().fromLegacy(new MaterialData(type, dataVal), true);
|
||||||
|
|
||||||
// We've converted now so the data val isn't a thing and can be reset
|
// We've converted now so the data val isn't a thing and can be reset
|
||||||
if (dataVal != 0) {
|
if (dataVal != 0) {
|
||||||
|
|
Loading…
Reference in a new issue