Advertisement
Guest User

Untitled

a guest
Jan 13th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. public static Item getItemByText(ICommandSender sender, String id) throws NumberInvalidException
  2. {
  3. ResourceLocation resourcelocation = new ResourceLocation(id);
  4. Item item = (Item)Item.itemRegistry.getObject(resourcelocation);
  5.  
  6. if (item == null)
  7. {
  8. throw new NumberInvalidException("commands.give.notFound", new Object[] {resourcelocation});
  9. }
  10. else
  11. {
  12. return item;
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement