mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-05 20:36:42 +00:00
Treat categories as empty when missing
This commit is contained in:
@ -19,8 +19,6 @@
|
||||
|
||||
package com.sk89q.worldedit.world.block;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Stores a list of categories of Block Types.
|
||||
*/
|
||||
@ -62,7 +60,11 @@ public final class BlockCategories {
|
||||
private BlockCategories() {
|
||||
}
|
||||
|
||||
public static @Nullable BlockCategory get(final String id) {
|
||||
return BlockCategory.REGISTRY.get(id);
|
||||
private static BlockCategory get(final String id) {
|
||||
BlockCategory blockCategory = BlockCategory.REGISTRY.get(id);
|
||||
if (blockCategory == null) {
|
||||
return new BlockCategory(id);
|
||||
}
|
||||
return blockCategory;
|
||||
}
|
||||
}
|
||||
|
@ -19,8 +19,6 @@
|
||||
|
||||
package com.sk89q.worldedit.world.item;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Stores a list of categories of Item Types.
|
||||
*/
|
||||
@ -60,7 +58,11 @@ public final class ItemCategories {
|
||||
private ItemCategories() {
|
||||
}
|
||||
|
||||
public static @Nullable ItemCategory get(final String id) {
|
||||
return ItemCategory.REGISTRY.get(id);
|
||||
private static ItemCategory get(final String id) {
|
||||
ItemCategory itemCategory = ItemCategory.REGISTRY.get(id);
|
||||
if (itemCategory == null) {
|
||||
return new ItemCategory(id);
|
||||
}
|
||||
return itemCategory;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user