Formatting

This commit is contained in:
2026-04-04 01:09:18 +02:00
parent 600f93c253
commit 6ff969f051
15 changed files with 177 additions and 87 deletions
@@ -45,14 +45,20 @@ public final class ItemUtils {
}
public static boolean isEggItem(ItemStack item) {
if (item == null) return false;
if (item == null) {
return false;
}
ItemMeta meta = item.getItemMeta();
if (meta == null) return false;
if (meta == null) {
return false;
}
return meta.getPersistentDataContainer().has(Keys.EGG_ITEM, PersistentDataType.STRING);
}
public static EggType getEggType(ItemStack item) {
if (!isEggItem(item)) return null;
if (!isEggItem(item)) {
return null;
}
String name = item.getItemMeta().getPersistentDataContainer().get(Keys.EGG_ITEM, PersistentDataType.STRING);
try {
return name == null ? null : EggType.valueOf(name);
@@ -65,11 +71,14 @@ public final class ItemUtils {
String[] parts = name.toLowerCase().split("_");
List<String> out = new ArrayList<>();
for (String p : parts) {
if (p.isEmpty()) continue;
if (p.isEmpty()) {
continue;
}
out.add(Character.toUpperCase(p.charAt(0)) + p.substring(1));
}
return String.join(" ", out);
}
private ItemUtils() {}
private ItemUtils() {
}
}