Fixed a few more errors, and added legacy support to the item parser.

This commit is contained in:
Matthew Miller
2018-07-24 17:12:50 +10:00
parent bc2279f2f6
commit 965e977411
13 changed files with 56 additions and 101 deletions

View File

@ -20,6 +20,7 @@
package com.sk89q.worldedit.world.registry;
import com.sk89q.worldedit.blocks.BaseItem;
import com.sk89q.worldedit.world.item.ItemType;
import com.sk89q.worldedit.world.item.ItemTypes;
import javax.annotation.Nullable;
@ -33,6 +34,7 @@ public class BundledItemRegistry implements ItemRegistry {
@Nullable
@Override
public BaseItem createFromId(String id) {
return new BaseItem(ItemTypes.get(id));
ItemType itemType = ItemTypes.get(id);
return itemType == null ? null : new BaseItem(itemType);
}
}