Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class LunariumDustRecipeSerializer extends ForgeRegistryEntry<IRecipeSerializer<?>> implements IRecipeSerializer<LunariumDustRecipe> {
- @Override
- public LunariumDustRecipe read(ResourceLocation recipeId, JsonObject json) {
- ItemStack output = CraftingHelper.getItemStack(JSONUtils.getJsonObject(json, "output"), true);
- Ingredient input = Ingredient.deserialize(JSONUtils.getJsonObject(json, "input"));
- return new LunariumDustRecipe(recipeId, input, output);
- }
- @Override
- public LunariumDustRecipe read(ResourceLocation recipeId, PacketBuffer buffer) {
- ItemStack output = buffer.readItemStack();
- Ingredient input = Ingredient.read(buffer);
- return new LunariumDustRecipe(recipeId, input, output);
- }
- @Override
- public void write(PacketBuffer buffer, LunariumDustRecipe recipe) {
- Ingredient input = recipe.getIngredients().get(0);
- input.write(buffer);
- buffer.writeItemStack(recipe.getRecipeOutput(), false);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement