Permalink
Browse files

Ensure BlockCategories are initialized.

We should probably have a way to initialize all these catalog classes ahead of time.
  • Loading branch information...
wizjany committed Feb 5, 2019
1 parent dddf2b9 commit cdd71178f5b052492851753e4bd9a2ead1d10b8f
@@ -26,6 +26,7 @@
import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.function.pattern.RandomPattern;
import com.sk89q.worldedit.internal.registry.InputParser;
import com.sk89q.worldedit.world.block.BlockCategories;
import com.sk89q.worldedit.world.block.BlockCategory;
import com.sk89q.worldedit.world.block.BlockType;

@@ -48,7 +49,7 @@ public Pattern parseFromInput(String input, ParserContext context) throws InputP
if(!input.startsWith("##")) {
return null;
}
BlockCategory category = BlockCategory.REGISTRY.get(input.substring(2).toLowerCase());
BlockCategory category = BlockCategories.get(input.substring(2).toLowerCase());
if (category == null) {
throw new InputParseException("Unknown block tag: " + input.substring(2));
}

0 comments on commit cdd7117

Please sign in to comment.