mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-22 13:09:42 +00:00
Create recipe generator for existing json recipes
This commit is contained in:
1 parent
59e0c6c987
commit
9cc6eb9870
20 files changed
+2940
-20
No files matched your search
@@ -23,7 +23,7 @@ import vazkii.botania.common.item.ItemAncientWill;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AncientWillRecipe extends SpecialRecipe {
|
||||
public static final IRecipeSerializer<AncientWillRecipe> SERIALIZER = new SpecialRecipeSerializer<>(AncientWillRecipe::new);
|
||||
public static final SpecialRecipeSerializer<AncientWillRecipe> SERIALIZER = new SpecialRecipeSerializer<>(AncientWillRecipe::new);
|
||||
|
||||
public AncientWillRecipe(ResourceLocation id) {
|
||||
super(id);
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* This class was created by <Hubry>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [2020-01-30, 19:13 (UTC+2)]
|
||||
*/
|
||||
package vazkii.botania.common.crafting.recipe;
|
||||
|
||||
import net.minecraft.inventory.CraftingInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.item.crafting.SpecialRecipe;
|
||||
import net.minecraft.item.crafting.SpecialRecipeSerializer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BannerRecipe extends SpecialRecipe {
|
||||
public static IRecipeSerializer<BannerRecipe> SERIALIZER = new SpecialRecipeSerializer<>(BannerRecipe::new);
|
||||
|
||||
public BannerRecipe(ResourceLocation id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(CraftingInventory inv, World worldIn) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(CraftingInventory inv) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFit(int width, int height) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRecipeSerializer<?> getSerializer() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -24,7 +24,7 @@ import vazkii.botania.common.item.ModItems;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlackHoleTalismanExtractRecipe extends SpecialRecipe {
|
||||
public static final IRecipeSerializer<BlackHoleTalismanExtractRecipe> SERIALIZER = new SpecialRecipeSerializer<>(BlackHoleTalismanExtractRecipe::new);
|
||||
public static final SpecialRecipeSerializer<BlackHoleTalismanExtractRecipe> SERIALIZER = new SpecialRecipeSerializer<>(BlackHoleTalismanExtractRecipe::new);
|
||||
|
||||
public BlackHoleTalismanExtractRecipe(ResourceLocation id) {
|
||||
super(id);
|
||||
|
||||
@@ -23,7 +23,7 @@ import vazkii.botania.api.mana.ICompositableLens;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CompositeLensRecipe extends SpecialRecipe {
|
||||
public static final IRecipeSerializer<CompositeLensRecipe> SERIALIZER = new SpecialRecipeSerializer<>(CompositeLensRecipe::new);
|
||||
public static final SpecialRecipeSerializer<CompositeLensRecipe> SERIALIZER = new SpecialRecipeSerializer<>(CompositeLensRecipe::new);
|
||||
|
||||
public CompositeLensRecipe(ResourceLocation id) {
|
||||
super(id);
|
||||
|
||||
@@ -23,7 +23,7 @@ import vazkii.botania.api.item.ICosmeticBauble;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CosmeticAttachRecipe extends SpecialRecipe {
|
||||
public static final IRecipeSerializer<CosmeticAttachRecipe> SERIALIZER = new SpecialRecipeSerializer<>(CosmeticAttachRecipe::new);
|
||||
public static final SpecialRecipeSerializer<CosmeticAttachRecipe> SERIALIZER = new SpecialRecipeSerializer<>(CosmeticAttachRecipe::new);
|
||||
|
||||
public CosmeticAttachRecipe(ResourceLocation id) {
|
||||
super(id);
|
||||
|
||||
@@ -23,7 +23,7 @@ import vazkii.botania.api.item.ICosmeticBauble;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CosmeticRemoveRecipe extends SpecialRecipe {
|
||||
public static final IRecipeSerializer<CosmeticRemoveRecipe> SERIALIZER = new SpecialRecipeSerializer<>(CosmeticRemoveRecipe::new);
|
||||
public static final SpecialRecipeSerializer<CosmeticRemoveRecipe> SERIALIZER = new SpecialRecipeSerializer<>(CosmeticRemoveRecipe::new);
|
||||
|
||||
public CosmeticRemoveRecipe(ResourceLocation id) {
|
||||
super(id);
|
||||
|
||||
@@ -24,7 +24,7 @@ import vazkii.botania.common.item.ModItems;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class KeepIvyRecipe extends SpecialRecipe {
|
||||
public static final IRecipeSerializer<KeepIvyRecipe> SERIALIZER = new SpecialRecipeSerializer<>(KeepIvyRecipe::new);
|
||||
public static final SpecialRecipeSerializer<KeepIvyRecipe> SERIALIZER = new SpecialRecipeSerializer<>(KeepIvyRecipe::new);
|
||||
|
||||
public KeepIvyRecipe(ResourceLocation id) {
|
||||
super(id);
|
||||
|
||||
@@ -28,7 +28,7 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class LensDyeingRecipe extends SpecialRecipe {
|
||||
public static final IRecipeSerializer<LensDyeingRecipe> SERIALIZER = new SpecialRecipeSerializer<>(LensDyeingRecipe::new);
|
||||
public static final SpecialRecipeSerializer<LensDyeingRecipe> SERIALIZER = new SpecialRecipeSerializer<>(LensDyeingRecipe::new);
|
||||
|
||||
private final List<Ingredient> dyes = Arrays.asList(
|
||||
Ingredient.fromTag(Tags.Items.DYES_WHITE), Ingredient.fromTag(Tags.Items.DYES_ORANGE),
|
||||
|
||||
@@ -23,7 +23,7 @@ import vazkii.botania.common.item.ModItems;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ManaGunClipRecipe extends SpecialRecipe {
|
||||
public static final IRecipeSerializer<ManaGunClipRecipe> SERIALIZER = new SpecialRecipeSerializer<>(ManaGunClipRecipe::new);
|
||||
public static final SpecialRecipeSerializer<ManaGunClipRecipe> SERIALIZER = new SpecialRecipeSerializer<>(ManaGunClipRecipe::new);
|
||||
|
||||
public ManaGunClipRecipe(ResourceLocation id) {
|
||||
super(id);
|
||||
|
||||
@@ -24,7 +24,7 @@ import vazkii.botania.common.item.ItemManaGun;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ManaGunLensRecipe extends SpecialRecipe {
|
||||
public static final IRecipeSerializer<ManaGunLensRecipe> SERIALIZER = new SpecialRecipeSerializer<>(ManaGunLensRecipe::new);
|
||||
public static final SpecialRecipeSerializer<ManaGunLensRecipe> SERIALIZER = new SpecialRecipeSerializer<>(ManaGunLensRecipe::new);
|
||||
|
||||
public ManaGunLensRecipe(ResourceLocation id) {
|
||||
super(id);
|
||||
|
||||
@@ -22,7 +22,7 @@ import vazkii.botania.common.item.ItemManaGun;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ManaGunRemoveLensRecipe extends SpecialRecipe {
|
||||
public static final IRecipeSerializer<ManaGunRemoveLensRecipe> SERIALIZER = new SpecialRecipeSerializer<>(ManaGunRemoveLensRecipe::new);
|
||||
public static final SpecialRecipeSerializer<ManaGunRemoveLensRecipe> SERIALIZER = new SpecialRecipeSerializer<>(ManaGunRemoveLensRecipe::new);
|
||||
|
||||
public ManaGunRemoveLensRecipe(ResourceLocation id) {
|
||||
super(id);
|
||||
|
||||
@@ -23,7 +23,7 @@ import vazkii.botania.common.item.ModItems;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class PhantomInkRecipe extends SpecialRecipe {
|
||||
public static final IRecipeSerializer<PhantomInkRecipe> SERIALIZER = new SpecialRecipeSerializer<>(PhantomInkRecipe::new);
|
||||
public static final SpecialRecipeSerializer<PhantomInkRecipe> SERIALIZER = new SpecialRecipeSerializer<>(PhantomInkRecipe::new);
|
||||
|
||||
public PhantomInkRecipe(ResourceLocation id) {
|
||||
super(id);
|
||||
|
||||
@@ -22,7 +22,7 @@ import vazkii.botania.common.item.ModItems;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class SpellClothRecipe extends SpecialRecipe {
|
||||
public static final IRecipeSerializer<SpellClothRecipe> SERIALIZER = new SpecialRecipeSerializer<>(SpellClothRecipe::new);
|
||||
public static final SpecialRecipeSerializer<SpellClothRecipe> SERIALIZER = new SpecialRecipeSerializer<>(SpellClothRecipe::new);
|
||||
|
||||
public SpellClothRecipe(ResourceLocation id) {
|
||||
super(id);
|
||||
|
||||
@@ -23,7 +23,7 @@ import vazkii.botania.common.item.equipment.tool.terrasteel.ItemTerraPick;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class TerraPickTippingRecipe extends SpecialRecipe {
|
||||
public static final IRecipeSerializer<TerraPickTippingRecipe> SERIALIZER = new SpecialRecipeSerializer<>(TerraPickTippingRecipe::new);
|
||||
public static final SpecialRecipeSerializer<TerraPickTippingRecipe> SERIALIZER = new SpecialRecipeSerializer<>(TerraPickTippingRecipe::new);
|
||||
|
||||
public TerraPickTippingRecipe(ResourceLocation id) {
|
||||
super(id);
|
||||
|
||||
@@ -12,6 +12,7 @@ package vazkii.botania.common.lib;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.item.DyeColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.tags.EntityTypeTags;
|
||||
@@ -34,6 +35,11 @@ public class ModTags {
|
||||
public static final Tag<Item> NUGGETS_MANASTEEL = forgeTag("nuggets/manasteel");
|
||||
public static final Tag<Item> NUGGETS_TERRASTEEL = forgeTag("nuggets/terrasteel");
|
||||
|
||||
public static final Tag<Item> BLOCKS_ELEMENTIUM = forgeTag("storage_blocks/elementium");
|
||||
public static final Tag<Item> BLOCKS_MANASTEEL = forgeTag("storage_blocks/manasteel");
|
||||
public static final Tag<Item> BLOCKS_TERRASTEEL = forgeTag("storage_blocks/terrasteel");
|
||||
public static final Tag<Item> BLOCKS_QUARTZ = forgeTag("storage_blocks/quartz");
|
||||
|
||||
public static final Tag<Item> MYSTICAL_FLOWERS = tag("mystical_flowers");
|
||||
public static final Tag<Item> DOUBLE_MYSTICAL_FLOWERS = tag("double_mystical_flowers");
|
||||
|
||||
@@ -95,6 +101,44 @@ public class ModTags {
|
||||
public static final Tag<Item> RUNES_WATER = tag("runes/water");
|
||||
public static final Tag<Item> RUNES_WINTER = tag("runes/winter");
|
||||
public static final Tag<Item> RUNES_WRATH = tag("runes/wrath");
|
||||
|
||||
public static Tag<Item> getFlowerTag(DyeColor color) {
|
||||
switch (color) {
|
||||
default:
|
||||
case WHITE:
|
||||
return PETALS_WHITE;
|
||||
case ORANGE:
|
||||
return PETALS_ORANGE;
|
||||
case MAGENTA:
|
||||
return PETALS_MAGENTA;
|
||||
case LIGHT_BLUE:
|
||||
return PETALS_LIGHT_BLUE;
|
||||
case YELLOW:
|
||||
return PETALS_YELLOW;
|
||||
case LIME:
|
||||
return PETALS_LIME;
|
||||
case PINK:
|
||||
return PETALS_PINK;
|
||||
case GRAY:
|
||||
return PETALS_GRAY;
|
||||
case LIGHT_GRAY:
|
||||
return PETALS_LIGHT_GRAY;
|
||||
case CYAN:
|
||||
return PETALS_CYAN;
|
||||
case PURPLE:
|
||||
return PETALS_PURPLE;
|
||||
case BLUE:
|
||||
return PETALS_BLUE;
|
||||
case BROWN:
|
||||
return PETALS_BROWN;
|
||||
case GREEN:
|
||||
return PETALS_GREEN;
|
||||
case RED:
|
||||
return PETALS_RED;
|
||||
case BLACK:
|
||||
return PETALS_BLACK;
|
||||
}
|
||||
}
|
||||
|
||||
private static Tag<Item> tag(String name) {
|
||||
return new ItemTags.Wrapper(new ResourceLocation(LibMisc.MOD_ID, name));
|
||||
@@ -122,6 +166,11 @@ public class ModTags {
|
||||
public static final Tag<Block> LIVINGROCK = tag("livingrock");
|
||||
public static final Tag<Block> LIVINGWOOD = tag("livingwood");
|
||||
|
||||
public static final Tag<Block> BLOCKS_ELEMENTIUM = forgeTag("storage_blocks/elementium");
|
||||
public static final Tag<Block> BLOCKS_MANASTEEL = forgeTag("storage_blocks/manasteel");
|
||||
public static final Tag<Block> BLOCKS_TERRASTEEL = forgeTag("storage_blocks/terrasteel");
|
||||
public static final Tag<Block> BLOCKS_QUARTZ = forgeTag("storage_blocks/quartz");
|
||||
|
||||
public static final Tag<Block> GAIA_BREAK_BLACKLIST = tag("gaia_break_blacklist");
|
||||
public static final Tag<Block> MAGNET_RING_BLACKLIST = tag("magnet_ring_blacklist");
|
||||
|
||||
@@ -131,6 +180,10 @@ public class ModTags {
|
||||
private static Tag<Block> tag(String name) {
|
||||
return new BlockTags.Wrapper(new ResourceLocation(LibMisc.MOD_ID, name));
|
||||
}
|
||||
|
||||
private static Tag<Block> forgeTag(String name) {
|
||||
return new BlockTags.Wrapper(new ResourceLocation("forge", name));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Entities {
|
||||
|
||||
@@ -7,11 +7,15 @@ import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
@Mod.EventBusSubscriber(modid = LibMisc.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
|
||||
public class DataGenerators {
|
||||
@SubscribeEvent
|
||||
public static void gatherData(GatherDataEvent evt) {
|
||||
evt.getGenerator().addProvider(new BlockLootProvider(evt.getGenerator()));
|
||||
evt.getGenerator().addProvider(new BlockTagProvider(evt.getGenerator()));
|
||||
evt.getGenerator().addProvider(new ItemTagProvider(evt.getGenerator()));
|
||||
evt.getGenerator().addProvider(new StonecuttingProvider(evt.getGenerator()));
|
||||
}
|
||||
@SubscribeEvent
|
||||
public static void gatherData(GatherDataEvent evt) {
|
||||
if (evt.includeServer()) {
|
||||
evt.getGenerator().addProvider(new BlockLootProvider(evt.getGenerator()));
|
||||
evt.getGenerator().addProvider(new BlockTagProvider(evt.getGenerator()));
|
||||
evt.getGenerator().addProvider(new ItemTagProvider(evt.getGenerator()));
|
||||
evt.getGenerator().addProvider(new StonecuttingProvider(evt.getGenerator()));
|
||||
evt.getGenerator().addProvider(new RecipeProvider(evt.getGenerator()));
|
||||
evt.getGenerator().addProvider(new SmeltingProvider(evt.getGenerator()));
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* This class was created by <Hubry>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [2020-02-12, 00:02 (UTC+2)]
|
||||
*/
|
||||
package vazkii.botania.data;
|
||||
|
||||
import net.minecraft.data.CookingRecipeBuilder;
|
||||
import net.minecraft.data.DataGenerator;
|
||||
import net.minecraft.data.IFinishedRecipe;
|
||||
import net.minecraft.data.RecipeProvider;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class SmeltingProvider extends RecipeProvider {
|
||||
public SmeltingProvider(DataGenerator generatorIn) {
|
||||
super(generatorIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRecipes(Consumer<IFinishedRecipe> consumer) {
|
||||
CookingRecipeBuilder.smeltingRecipe(Ingredient.fromItems(ModFluffBlocks.biomeCobblestoneForest), ModFluffBlocks.biomeStoneForest, 0.1f, 200)
|
||||
.addCriterion("has_item", hasItem(ModFluffBlocks.biomeCobblestoneForest))
|
||||
.build(consumer, "botania:smelting/metamorphic_forest_stone");
|
||||
CookingRecipeBuilder.smeltingRecipe(Ingredient.fromItems(ModFluffBlocks.biomeCobblestonePlains), ModFluffBlocks.biomeStonePlains, 0.1f, 200)
|
||||
.addCriterion("has_item", hasItem(ModFluffBlocks.biomeCobblestonePlains))
|
||||
.build(consumer, "botania:smelting/metamorphic_plains_stone");
|
||||
CookingRecipeBuilder.smeltingRecipe(Ingredient.fromItems(ModFluffBlocks.biomeCobblestoneMountain), ModFluffBlocks.biomeStoneMountain, 0.1f, 200)
|
||||
.addCriterion("has_item", hasItem(ModFluffBlocks.biomeCobblestoneMountain))
|
||||
.build(consumer, "botania:smelting/metamorphic_mountain_stone");
|
||||
CookingRecipeBuilder.smeltingRecipe(Ingredient.fromItems(ModFluffBlocks.biomeCobblestoneFungal), ModFluffBlocks.biomeStoneFungal, 0.1f, 200)
|
||||
.addCriterion("has_item", hasItem(ModFluffBlocks.biomeCobblestoneFungal))
|
||||
.build(consumer, "botania:smelting/metamorphic_fungal_stone");
|
||||
CookingRecipeBuilder.smeltingRecipe(Ingredient.fromItems(ModFluffBlocks.biomeCobblestoneSwamp), ModFluffBlocks.biomeStoneSwamp, 0.1f, 200)
|
||||
.addCriterion("has_item", hasItem(ModFluffBlocks.biomeCobblestoneSwamp))
|
||||
.build(consumer, "botania:smelting/metamorphic_swamp_stone");
|
||||
CookingRecipeBuilder.smeltingRecipe(Ingredient.fromItems(ModFluffBlocks.biomeCobblestoneDesert), ModFluffBlocks.biomeStoneDesert, 0.1f, 200)
|
||||
.addCriterion("has_item", hasItem(ModFluffBlocks.biomeCobblestoneDesert))
|
||||
.build(consumer, "botania:smelting/metamorphic_desert_stone");
|
||||
CookingRecipeBuilder.smeltingRecipe(Ingredient.fromItems(ModFluffBlocks.biomeCobblestoneTaiga), ModFluffBlocks.biomeStoneTaiga, 0.1f, 200)
|
||||
.addCriterion("has_item", hasItem(ModFluffBlocks.biomeCobblestoneTaiga))
|
||||
.build(consumer, "botania:smelting/metamorphic_taiga_stone");
|
||||
CookingRecipeBuilder.smeltingRecipe(Ingredient.fromItems(ModFluffBlocks.biomeCobblestoneMesa), ModFluffBlocks.biomeStoneMesa, 0.1f, 200)
|
||||
.addCriterion("has_item", hasItem(ModFluffBlocks.biomeCobblestoneMesa))
|
||||
.build(consumer, "botania:smelting/metamorphic_mesa_stone");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Botania smelting recipes";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
/**
|
||||
* This class was created by <Hubry>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [2020-02-12, 19:29 (UTC+2)]
|
||||
*/
|
||||
package vazkii.botania.data;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import net.minecraft.data.IFinishedRecipe;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class WrapperResult implements IFinishedRecipe {
|
||||
private final IFinishedRecipe delegate;
|
||||
@Nullable
|
||||
private final IRecipeSerializer<?> type;
|
||||
@Nullable
|
||||
private final Consumer<JsonObject> transform;
|
||||
|
||||
/**
|
||||
* Wraps recipe consumer with one that swaps the recipe type to a different one.
|
||||
*/
|
||||
public static Consumer<IFinishedRecipe> ofType(IRecipeSerializer<?> type, Consumer<IFinishedRecipe> parent) {
|
||||
return recipe -> parent.accept(new WrapperResult(recipe, type, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* Transforms the resulting recipe json with the specified action, eg. adding NBT to an item result.
|
||||
*/
|
||||
public static Consumer<IFinishedRecipe> transformJson(Consumer<IFinishedRecipe> parent, Consumer<JsonObject> transform) {
|
||||
return recipe -> parent.accept(new WrapperResult(recipe, null, transform));
|
||||
}
|
||||
|
||||
private WrapperResult(IFinishedRecipe delegate, @Nullable IRecipeSerializer<?> type, @Nullable Consumer<JsonObject> transform) {
|
||||
this.delegate = delegate;
|
||||
this.type = type;
|
||||
this.transform = transform;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(JsonObject json) {
|
||||
delegate.serialize(json);
|
||||
if(transform != null)
|
||||
transform.accept(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonObject getRecipeJson() {
|
||||
if(type == null)
|
||||
return IFinishedRecipe.super.getRecipeJson();
|
||||
JsonObject jsonobject = new JsonObject();
|
||||
jsonobject.addProperty("type", this.type.getRegistryName().toString());
|
||||
this.serialize(jsonobject);
|
||||
return jsonobject;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getID() {
|
||||
return delegate.getID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRecipeSerializer<?> getSerializer() {
|
||||
return type != null ? type : delegate.getSerializer();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public JsonObject getAdvancementJson() {
|
||||
return delegate.getAdvancementJson();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ResourceLocation getAdvancementID() {
|
||||
return delegate.getAdvancementID();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
@javax.annotation.ParametersAreNonnullByDefault
|
||||
@mcp.MethodsReturnNonnullByDefault
|
||||
package vazkii.botania.data;
|
||||
Reference in new issue
Block a user