Advertisement
Guest User

Untitled

a guest
Feb 1st, 2021
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. package com.nick.humlands.common.recipe;
  2.  
  3. import com.nick.humlands.core.init.RecipeSerializerInit;
  4.  
  5. import net.minecraft.item.ItemStack;
  6. import net.minecraft.item.crafting.IRecipeSerializer;
  7. import net.minecraft.item.crafting.Ingredient;
  8. import net.minecraft.util.NonNullList;
  9. import net.minecraft.util.ResourceLocation;
  10. import net.minecraft.world.World;
  11. import net.minecraftforge.items.wrapper.RecipeWrapper;
  12.  
  13. public class SculptorRecipe implements ISculptorRecipe {
  14.  
  15. private final ResourceLocation id;
  16. private Ingredient input;
  17. private final ItemStack output;
  18.  
  19. public SculptorRecipe(ResourceLocation id, Ingredient input, ItemStack output) {
  20. this.id = id;
  21. this.output = output;
  22. this.input = input;
  23. }
  24.  
  25. @Override
  26. public boolean matches(RecipeWrapper inv, World worldIn) {
  27. if (this.input.test(inv.getStackInSlot(0))) {
  28. return true;
  29. }
  30. return false;
  31. }
  32.  
  33. @Override
  34. public ItemStack getCraftingResult(RecipeWrapper inv) {
  35. return this.output;
  36. }
  37.  
  38. @Override
  39. public ItemStack getRecipeOutput() {
  40. return this.output;
  41. }
  42.  
  43. @Override
  44. public ResourceLocation getId() {
  45. return this.id;
  46. }
  47.  
  48. @Override
  49. public IRecipeSerializer<?> getSerializer() {
  50. return RecipeSerializerInit.SCULPTOR_SERIALIZER.get();
  51. }
  52.  
  53. @Override
  54. public Ingredient getInput() {
  55. return this.input;
  56. }
  57.  
  58. @Override
  59. public NonNullList<Ingredient> getIngredients() {
  60. return NonNullList.from(null, this.input);
  61. }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement