Advertisement
Guest User

Untitled

a guest
Jul 14th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. public class GeomancyRecipe extends ShapelessOreRecipe {
  2. //public ItemStack result;
  3. public String tag;
  4.  
  5.  
  6. public GeomancyRecipe(Block result, String tag, Object... recipe) {
  7. super(result, recipe);
  8. this.tag = tag;
  9.  
  10. }
  11.  
  12. public GeomancyRecipe(Item result, String tag, Object... recipe) {
  13. super(result, recipe);
  14. this.tag = tag;
  15.  
  16. }
  17.  
  18. public GeomancyRecipe(ItemStack result, String tag, Object... recipe) {
  19. super(result, recipe);
  20. this.tag = tag;
  21. }
  22.  
  23.  
  24. @Override
  25. public ItemStack getCraftingResult(InventoryCrafting inventory) {
  26.  
  27. ItemStack result = null;
  28.  
  29.  
  30. for (int i = 0; i < inventory.getSizeInventory(); ++i) {
  31. ItemStack stack = inventory.getStackInSlot(i);
  32.  
  33. if (stack != null && stack.getItem() == ItemRegistry.talisman) {
  34. result = stack.copy();
  35. result.stackSize = 1;
  36. break;
  37. }
  38. }
  39. //result.stackTagCompound = new NBTTagCompound();
  40.  
  41. if (!result.hasTagCompound()) {
  42. result.stackTagCompound = new NBTTagCompound();
  43. }
  44. if (!result.stackTagCompound.hasKey(tag)) {
  45. result.stackTagCompound.setString(tag, tag);
  46.  
  47. }
  48.  
  49.  
  50. return result;
  51.  
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement