Advertisement
Exokem

Untitled

Apr 17th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.93 KB | None | 0 0
  1. public class ExkvaRecipeData {
  2.  
  3.     static class RecipeIn {
  4.  
  5.         private ItemStack[] in;
  6.  
  7.         RecipeIn(ItemStack[] input) {
  8.             this.in = input.clone();
  9.         }
  10.     }
  11.  
  12.     static class RecipeOut {
  13.  
  14.         private Item out;
  15.         private int amt;
  16.  
  17.         RecipeOut(Item item, int quantity) {
  18.             this.out = item;
  19.             this.amt = quantity;
  20.         }
  21.  
  22.         public Item getOut() { return out; }
  23.  
  24.         public int getAmt() { return amt; }
  25.     }
  26.  
  27.     protected static Map<RecipeIn, RecipeOut> recipes = new HashMap<RecipeIn, RecipeOut>();
  28.  
  29.     public static void registerRecipe(ItemStack[] input, Item output, int quantity) {
  30.  
  31.         recipes.put(new RecipeIn(input), new RecipeOut(output, quantity));
  32.     }
  33.  
  34.     public static ItemStack getOutput(RecipeIn in) {
  35.         RecipeOut result = recipes.get(in);
  36.         return new ItemStack(result.getOut(), result.getAmt());
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement