HalestormXV

LunarForgeRecipe

Oct 25th, 2020
880
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.halestormxv.mysterium.recipes;
  2.  
  3. import com.halestormxv.mysterium.init.RecipeSerializerInit;
  4. import net.minecraft.item.ItemStack;
  5. import net.minecraft.item.crafting.IRecipeSerializer;
  6. import net.minecraft.item.crafting.Ingredient;
  7. import net.minecraft.util.NonNullList;
  8. import net.minecraft.util.ResourceLocation;
  9. import net.minecraft.world.World;
  10. import net.minecraftforge.items.wrapper.RecipeWrapper;
  11.  
  12. public class LunarForgeRecipe implements ILunarForgeRecipe {
  13.  
  14.     protected final ResourceLocation id;
  15.     protected final Ingredient input;
  16.     protected final ItemStack output;
  17.     protected final float xp;
  18.     protected final int cookTime;
  19.  
  20.     public LunarForgeRecipe(ResourceLocation id, Ingredient input, ItemStack output, float xp, int cookTime) {
  21.         this.id = id;
  22.         this.output = output;
  23.         this.input = input;
  24.         this.xp = xp;
  25.         this.cookTime = cookTime;
  26.  
  27.     }
  28.  
  29.     @Override
  30.     public boolean matches(RecipeWrapper inv, World worldIn) {
  31.         if (this.input.test(inv.getStackInSlot(0))) {
  32.             return true;
  33.         }
  34.         return false;
  35.     }
  36.  
  37.     @Override
  38.     public ItemStack getCraftingResult(RecipeWrapper inv) {
  39.         return this.output;
  40.     }
  41.  
  42.     @Override
  43.     public ItemStack getRecipeOutput() {
  44.         return this.output;
  45.     }
  46.  
  47.     @Override
  48.     public ResourceLocation getId() {
  49.         return this.id;
  50.     }
  51.  
  52.     @Override
  53.     public IRecipeSerializer<?> getSerializer() {
  54.         return RecipeSerializerInit.LUNAR_FORGE_SERIALIZER.get();
  55.     }
  56.  
  57.     @Override
  58.     public Ingredient getInput() {
  59.         return this.input;
  60.     }
  61.  
  62.     @Override
  63.     public NonNullList<Ingredient> getIngredients() {
  64.         return NonNullList.from(null, this.input);
  65.     }
  66.  
  67.     public float getXp(){
  68.         return this.xp;
  69.     }
  70.  
  71.     public int getCookTime(){
  72.         return this.cookTime;
  73.     }
  74. }
  75.  
RAW Paste Data