Search in sources :

Example 1 with SimpleItem

use of com.simplycmd.featherlib.registry.SimpleItem 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)

Example 2 with SimpleItem

use of com.simplycmd.featherlib.registry.SimpleItem in project Terracraft by SimplyCmd.

the class ItemRegistry method register.

public static void register() {
    magic_mirror = new SimpleItem(ID("magic_mirror"), new MirrorItem(new FabricItemSettings().group(ItemGroup.MISC).maxCount(1))).defaultItemModel();
    grenade = new SimpleItem(ID("grenade"), new GrenadeThrowableItem(new FabricItemSettings().group(ItemGroup.COMBAT))).defaultItemModel();
    flaming_arrow = new SimpleItem(ID("flaming_arrow"), new FlamingArrowItem()).defaultItemModel();
    soul_fire_arrow = new SimpleItem(ID("soul_fire_arrow"), new FlamingArrowItem()).defaultItemModel();
    slap_hand = new SimpleItem(ID("slap_hand"), new SlapHandItem()).defaultItemModel();
    wand_of_sparking = new SimpleItem(ID("wand_of_sparking"), new WandOfSparkingItem(new FabricItemSettings().group(ItemGroup.COMBAT).maxCount(1).maxDamage(250))).defaultItemModel();
    heart = new SimpleItem(ID("heart"), new HeartItem()).defaultItemModel();
    umbrella = new SimpleItem(ID("umbrella"), new UmbrellaItem());
    sickle = new SimpleItem(ID("sickle"), new SickleItem()).defaultItemModel();
    daybloom = new SimpleItem(ID("daybloom"), new Item(new FabricItemSettings().group(ItemGroup.MATERIALS)));
    daybloom_seeds = new SimpleItem(ID("daybloom_seeds"), new AliasedBlockItem(BlockRegistry.daybloom.getBlock(), new FabricItemSettings().group(ItemGroup.MISC)));
    blue_berries = new SimpleItem(ID("blue_berries"), new AliasedBlockItem(BlockRegistry.blue_berry_bush.getBlock(), new FabricItemSettings().group(ItemGroup.MISC)));
    platinum_coin = new SimpleItem(ID("platinum_coin"), new CoinItem(new Value(1, 0, 0, 0), null)).defaultItemModel();
    gold_coin = new SimpleItem(ID("gold_coin"), new CoinItem(new Value(0, 1, 0, 0), ItemRegistry.platinum_coin.getItem())).defaultItemModel();
    silver_coin = new SimpleItem(ID("silver_coin"), new CoinItem(new Value(0, 0, 1, 0), ItemRegistry.gold_coin.getItem())).defaultItemModel();
    copper_coin = new SimpleItem(ID("copper_coin"), new CoinItem(new Value(0, 0, 0, 1), ItemRegistry.silver_coin.getItem())).defaultItemModel();
    cactus_helmet = new SimpleItem(ID("cactus_helmet"), new ArmorItem(ArmorMaterials.CACTUS, EquipmentSlot.HEAD, new FabricItemSettings().group(ItemGroup.COMBAT))).defaultItemModel();
    cactus_chestplate = new SimpleItem(ID("cactus_chestplate"), new ArmorItem(ArmorMaterials.CACTUS, EquipmentSlot.CHEST, new FabricItemSettings().group(ItemGroup.COMBAT))).defaultItemModel();
    cactus_leggings = new SimpleItem(ID("cactus_leggings"), new ArmorItem(ArmorMaterials.CACTUS, EquipmentSlot.LEGS, new FabricItemSettings().group(ItemGroup.COMBAT))).defaultItemModel();
    cactus_boots = new SimpleItem(ID("cactus_boots"), new ArmorItem(ArmorMaterials.CACTUS, EquipmentSlot.FEET, new FabricItemSettings().group(ItemGroup.COMBAT))).defaultItemModel();
    cactus_sword = new SimpleItem(ID("cactus_sword"), new SwordItem(ToolMaterials.CACTUS, 3, -2.4F, new FabricItemSettings().group(ItemGroup.COMBAT))).defaultItemModel();
    cactus_shovel = new SimpleItem(ID("cactus_shovel"), new ShovelItem(ToolMaterials.CACTUS, 1.5F, -3.0F, new FabricItemSettings().group(ItemGroup.TOOLS))).defaultItemModel();
    cactus_pickaxe = new SimpleItem(ID("cactus_pickaxe"), new PickaxeItem(ToolMaterials.CACTUS, 1, -2.8F, new FabricItemSettings().group(ItemGroup.TOOLS))).defaultItemModel();
    cactus_axe = new SimpleItem(ID("cactus_axe"), new AxeItem(ToolMaterials.CACTUS, 6.0F, -3.2F, new FabricItemSettings().group(ItemGroup.TOOLS))).defaultItemModel();
    cactus_hoe = new SimpleItem(ID("cactus_hoe"), new HoeItem(ToolMaterials.CACTUS, 0, -3.0F, new FabricItemSettings().group(ItemGroup.TOOLS))).defaultItemModel();
}
Also used : FabricItemSettings(net.fabricmc.fabric.api.item.v1.FabricItemSettings) AliasedBlockItem(net.minecraft.item.AliasedBlockItem) SwordItem(net.minecraft.item.SwordItem) Item(net.minecraft.item.Item) AliasedBlockItem(net.minecraft.item.AliasedBlockItem) ShovelItem(net.minecraft.item.ShovelItem) SwordItem(net.minecraft.item.SwordItem) SimpleItem(com.simplycmd.featherlib.registry.SimpleItem) ArmorItem(net.minecraft.item.ArmorItem) ArmorItem(net.minecraft.item.ArmorItem) ShovelItem(net.minecraft.item.ShovelItem) SimpleItem(com.simplycmd.featherlib.registry.SimpleItem)

Aggregations

SimpleItem (com.simplycmd.featherlib.registry.SimpleItem)2 FabricItemSettings (net.fabricmc.fabric.api.item.v1.FabricItemSettings)2 Resources (com.simplycmd.featherlib.registry.Resources)1 SimpleBlock (com.simplycmd.featherlib.registry.SimpleBlock)1 ItemModel (com.simplycmd.featherlib.registry.SimpleBlock.ItemModel)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 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 AliasedBlockItem (net.minecraft.item.AliasedBlockItem)1 ArmorItem (net.minecraft.item.ArmorItem)1 Item (net.minecraft.item.Item)1