Fixed the item parser not using the ItemRegistry

This commit is contained in:
Matthew Miller
2018-12-23 19:02:58 +10:00
parent c5d9aadab8
commit 6312bcecf6
4 changed files with 6 additions and 44 deletions

View File

@ -19,22 +19,10 @@
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;
/**
* A item registry that uses {@link BundledItemRegistry} to serve information
* about items.
*/
public class BundledItemRegistry implements ItemRegistry {
@Nullable
@Override
public BaseItem createFromId(String id) {
ItemType itemType = ItemTypes.get(id);
return itemType == null ? null : new BaseItem(itemType);
}
}

View File

@ -19,19 +19,6 @@
package com.sk89q.worldedit.world.registry;
import com.sk89q.worldedit.blocks.BaseItem;
import javax.annotation.Nullable;
public interface ItemRegistry {
/**
* Create a new item using its ID.
*
* @param id the id
* @return the item, which may be null if no item exists
*/
@Nullable
BaseItem createFromId(String id);
}