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,23 +19,8 @@
package com.sk89q.worldedit.forge;
import com.sk89q.worldedit.blocks.BaseItem;
import com.sk89q.worldedit.world.item.ItemTypes;
import com.sk89q.worldedit.world.registry.ItemRegistry;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import javax.annotation.Nullable;
public class ForgeItemRegistry implements ItemRegistry {
@Nullable
@Override
public BaseItem createFromId(String id) {
Item match = Item.REGISTRY.getObject(new ResourceLocation(id));
if (match != null) {
return new BaseItem(ItemTypes.get(id));
} else {
return null;
}
}
}