Search in sources :

Example 1 with JIngredient

use of net.devtech.arrp.json.recipe.JIngredient in project Terracraft by SimplyCmd.

the class BlockRegistry method torch.

private static Torch torch(String prefix, ParticleType<?> particle, JIngredient resource) {
    final String torch = prefix + "_torch";
    final String wallTorch = prefix + "_wall_torch";
    final SimpleBlock block1 = new SimpleBlock(ID(torch), new CustomTorchBlock(FabricBlockSettings.of(Material.DECORATION).noCollision().breakInstantly().luminance((state) -> 10).sounds(BlockSoundGroup.WOOD), ParticleTypes.SOUL_FIRE_FLAME));
    final SimpleBlock block2 = new SimpleBlock(ID(wallTorch), new CustomWallTorchBlock(FabricBlockSettings.of(Material.DECORATION).noCollision().breakInstantly().luminance((state) -> 10).sounds(BlockSoundGroup.WOOD), ParticleTypes.SOUL_FIRE_FLAME));
    final SimpleItem item1 = new SimpleItem(ID(torch), new WallStandingBlockItem(block1.getBlock(), block2.getBlock(), new FabricItemSettings().group(ItemGroup.DECORATIONS))).blockItemModel(block1.getBlock());
    // Delay this until after said items are registered
    Resources.RESOURCE_PACK.addRecipe(ID(torch), JRecipe.shaped(JPattern.pattern("X", "#", "S"), JKeys.keys().key("X", JIngredient.ingredient().item(Items.COAL).item(Items.CHARCOAL)).key("#", JIngredient.ingredient().item(Items.STICK)).key("S", resource), JResult.itemStack(item1.getItem(), 4)));
    return new Torch(block1, block2, item1);
}
Also used : SimpleBlock(com.simplycmd.featherlib.registry.SimpleBlock) io.github.simplycmd.terracraft.blocks(io.github.simplycmd.terracraft.blocks) JRecipe(net.devtech.arrp.json.recipe.JRecipe) Getter(lombok.Getter) ParticleType(net.minecraft.particle.ParticleType) FabricBlockSettings(net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings) LifeCrystalBlockItem(io.github.simplycmd.terracraft.blocks.items.LifeCrystalBlockItem) SimpleBlock(com.simplycmd.featherlib.registry.SimpleBlock) JIngredient(net.devtech.arrp.json.recipe.JIngredient) net.minecraft.item(net.minecraft.item) JKeys(net.devtech.arrp.json.recipe.JKeys) FabricItemSettings(net.fabricmc.fabric.api.item.v1.FabricItemSettings) net.minecraft.block(net.minecraft.block) ParticleTypes(net.minecraft.particle.ParticleTypes) ItemModel(com.simplycmd.featherlib.registry.SimpleBlock.ItemModel) Resources(com.simplycmd.featherlib.registry.Resources) Identifier(net.minecraft.util.Identifier) JResult(net.devtech.arrp.json.recipe.JResult) SimpleItem(com.simplycmd.featherlib.registry.SimpleItem) JPattern(net.devtech.arrp.json.recipe.JPattern) Main(io.github.simplycmd.terracraft.Main) BlockSoundGroup(net.minecraft.sound.BlockSoundGroup) FabricItemSettings(net.fabricmc.fabric.api.item.v1.FabricItemSettings) SimpleItem(com.simplycmd.featherlib.registry.SimpleItem)

Aggregations

Resources (com.simplycmd.featherlib.registry.Resources)1 SimpleBlock (com.simplycmd.featherlib.registry.SimpleBlock)1 ItemModel (com.simplycmd.featherlib.registry.SimpleBlock.ItemModel)1 SimpleItem (com.simplycmd.featherlib.registry.SimpleItem)1 Main (io.github.simplycmd.terracraft.Main)1 io.github.simplycmd.terracraft.blocks (io.github.simplycmd.terracraft.blocks)1 LifeCrystalBlockItem (io.github.simplycmd.terracraft.blocks.items.LifeCrystalBlockItem)1 Getter (lombok.Getter)1 JIngredient (net.devtech.arrp.json.recipe.JIngredient)1 JKeys (net.devtech.arrp.json.recipe.JKeys)1 JPattern (net.devtech.arrp.json.recipe.JPattern)1 JRecipe (net.devtech.arrp.json.recipe.JRecipe)1 JResult (net.devtech.arrp.json.recipe.JResult)1 FabricItemSettings (net.fabricmc.fabric.api.item.v1.FabricItemSettings)1 FabricBlockSettings (net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings)1 net.minecraft.block (net.minecraft.block)1 net.minecraft.item (net.minecraft.item)1 ParticleType (net.minecraft.particle.ParticleType)1 ParticleTypes (net.minecraft.particle.ParticleTypes)1 BlockSoundGroup (net.minecraft.sound.BlockSoundGroup)1