mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-20 23:46:57 +01:00
Improve CreativeCategory conversion
By: md_5 <git@md-5.net>
This commit is contained in:
parent
16d405ff1c
commit
ec402c4974
1 changed files with 7 additions and 2 deletions
|
@ -20,10 +20,15 @@ public final class CraftCreativeCategory {
|
|||
.build();
|
||||
|
||||
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.");
|
||||
}
|
||||
|
||||
return (tab != null) ? NMS_TO_BUKKIT.get(tab) : null;
|
||||
return bukkit;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue