mirror of
https://e.coding.net/circlecloud/YumCore.git
synced 2024-12-24 06:58:51 +00:00
fix: 1.13+ Material Error
Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
parent
c7867ed835
commit
d438c9a5f1
@ -104,16 +104,18 @@ public class L10N {
|
||||
private static String getItemType(ItemStack i) {
|
||||
String name = i.getType().name();
|
||||
String dura = "";
|
||||
if (i.getType() == Material.MONSTER_EGG) {
|
||||
try {
|
||||
name = ((SpawnEgg) i.getData()).getSpawnedType().name();
|
||||
} catch (NullPointerException npe) {
|
||||
name = ((SpawnEggMeta) i.getItemMeta()).getSpawnedType().name();
|
||||
try {
|
||||
if (i.getType() == Material.MONSTER_EGG) {
|
||||
try {
|
||||
name = ((SpawnEgg) i.getData()).getSpawnedType().name();
|
||||
} catch (NullPointerException npe) {
|
||||
name = ((SpawnEggMeta) i.getItemMeta()).getSpawnedType().name();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int dur = i.getDurability();
|
||||
dura = (i.getMaxStackSize() != 1 && dur != 0) ? Integer.toString(dur) : "";
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
int dur = i.getDurability();
|
||||
dura = (i.getMaxStackSize() != 1 && dur != 0) ? Integer.toString(dur) : "";
|
||||
return (name + (dura.isEmpty() ? "" : "-" + dura)).toUpperCase();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user