geforkt von Mirrors/Paper
Improve CreativeCategory conversion
By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
Ursprung
16d405ff1c
Commit
ec402c4974
@ -20,10 +20,15 @@ public final class CraftCreativeCategory {
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
public static CreativeCategory fromNMS(CreativeModeTab tab) {
|
public static CreativeCategory fromNMS(CreativeModeTab tab) {
|
||||||
if (!NMS_TO_BUKKIT.containsKey(tab)) {
|
if (tab == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
CreativeCategory bukkit = NMS_TO_BUKKIT.get(tab);
|
||||||
|
if (bukkit == null) {
|
||||||
throw new UnsupportedOperationException("Item is not present in any known CreativeModeTab. This is a bug.");
|
throw new UnsupportedOperationException("Item is not present in any known CreativeModeTab. This is a bug.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return (tab != null) ? NMS_TO_BUKKIT.get(tab) : null;
|
return bukkit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren