Add data generation. (#4399)

Recipe and other Data Generators
This commit is contained in:
Eutro
2020-06-02 22:13:49 +01:00
committed by GitHub
parent 1056629545
commit 58afa6539f
139 changed files with 2702 additions and 962 deletions
@@ -1,36 +0,0 @@
package appeng.recipes.handlers;
import com.google.gson.JsonObject;
import net.minecraft.item.ItemStack;
import net.minecraft.util.JSONUtils;
import net.minecraftforge.common.crafting.CraftingHelper;
import net.minecraftforge.common.crafting.JsonContext;
import net.minecraftforge.fml.common.registry.GameRegistry;
import appeng.recipes.IAERecipeFactory;
import appeng.recipes.factories.recipes.PartRecipeFactory;
public class SmeltingHandler implements IAERecipeFactory
{
@Override
public void register( JsonObject json, JsonContext ctx )
{
ItemStack result = PartRecipeFactory.getResult( json, ctx );
ItemStack[] input = CraftingHelper.getIngredient( json.get( "input" ), ctx ).getMatchingStacks();
float xp = 0.0f;
if( json.has( "xp" ) )
{
xp = JSONUtils.getFloat( json, "xp" );
}
for( int i = 0; i < input.length; ++i )
{
GameRegistry.addSmelting( input[i], result, xp );
}
}
}