Search in sources :

Example 6 with FabricItemSettings

use of net.fabricmc.fabric.api.item.v1.FabricItemSettings in project winterly by tyap-lyap.

the class WinterlyItems method settings.

private static FabricItemSettings settings() {
    FabricItemSettings settings = new FabricItemSettings();
    settings.group(WinterlyMod.ITEM_GROUP);
    return settings;
}
Also used : FabricItemSettings(net.fabricmc.fabric.api.item.v1.FabricItemSettings)

Example 7 with FabricItemSettings

use of net.fabricmc.fabric.api.item.v1.FabricItemSettings in project BCLib by paulevsGitch.

the class WoodenComplexMaterial method initStorage.

protected final void initStorage(FabricBlockSettings blockSettings, FabricItemSettings itemSettings) {
    addBlockEntry(new BlockEntry(BLOCK_CHEST, (complexMaterial, settings) -> new BaseChestBlock(getBlock(BLOCK_PLANKS))).setBlockTags(NamedCommonBlockTags.CHEST, NamedCommonBlockTags.WOODEN_CHEST).setItemTags(NamedCommonItemTags.CHEST, NamedCommonItemTags.WOODEN_CHEST));
    addBlockEntry(new BlockEntry(BLOCK_BARREL, (complexMaterial, settings) -> new BaseBarrelBlock(getBlock(BLOCK_PLANKS))).setBlockTags(NamedCommonBlockTags.BARREL, NamedCommonBlockTags.WOODEN_BARREL).setItemTags(NamedCommonItemTags.BARREL, NamedCommonItemTags.WOODEN_BARREL));
}
Also used : ResourceLocation(net.minecraft.resources.ResourceLocation) NamedItemTags(ru.bclib.api.tag.NamedItemTags) BaseChestBlock(ru.bclib.blocks.BaseChestBlock) BaseGateBlock(ru.bclib.blocks.BaseGateBlock) Items(net.minecraft.world.item.Items) BaseSlabBlock(ru.bclib.blocks.BaseSlabBlock) StripableBarkBlock(ru.bclib.blocks.StripableBarkBlock) TagLocation(ru.bclib.api.tag.TagAPI.TagLocation) Item(net.minecraft.world.item.Item) RecipeEntry(ru.bclib.complexmaterials.entry.RecipeEntry) BaseDoorBlock(ru.bclib.blocks.BaseDoorBlock) BaseCraftingTableBlock(ru.bclib.blocks.BaseCraftingTableBlock) MaterialColor(net.minecraft.world.level.material.MaterialColor) BaseTrapdoorBlock(ru.bclib.blocks.BaseTrapdoorBlock) WoodenPressurePlateBlock(ru.bclib.blocks.WoodenPressurePlateBlock) FabricItemSettings(net.fabricmc.fabric.api.item.v1.FabricItemSettings) BaseWoodenButtonBlock(ru.bclib.blocks.BaseWoodenButtonBlock) NamedBlockTags(ru.bclib.api.tag.NamedBlockTags) BaseStripableLogBlock(ru.bclib.blocks.BaseStripableLogBlock) NamedCommonBlockTags(ru.bclib.api.tag.NamedCommonBlockTags) TagAPI(ru.bclib.api.tag.TagAPI) NamedCommonItemTags(ru.bclib.api.tag.NamedCommonItemTags) BaseBarrelBlock(ru.bclib.blocks.BaseBarrelBlock) BaseSignBlock(ru.bclib.blocks.BaseSignBlock) FabricBlockSettings(net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings) BaseBarkBlock(ru.bclib.blocks.BaseBarkBlock) BCLib(ru.bclib.BCLib) BaseFenceBlock(ru.bclib.blocks.BaseFenceBlock) Blocks(net.minecraft.world.level.block.Blocks) BaseStairsBlock(ru.bclib.blocks.BaseStairsBlock) BaseBookshelfBlock(ru.bclib.blocks.BaseBookshelfBlock) BaseRotatedPillarBlock(ru.bclib.blocks.BaseRotatedPillarBlock) BaseBlock(ru.bclib.blocks.BaseBlock) BaseLadderBlock(ru.bclib.blocks.BaseLadderBlock) Block(net.minecraft.world.level.block.Block) GridRecipe(ru.bclib.recipes.GridRecipe) BaseComposterBlock(ru.bclib.blocks.BaseComposterBlock) BlockEntry(ru.bclib.complexmaterials.entry.BlockEntry) FlammableBlockRegistry(net.fabricmc.fabric.api.registry.FlammableBlockRegistry) BlockEntry(ru.bclib.complexmaterials.entry.BlockEntry) BaseChestBlock(ru.bclib.blocks.BaseChestBlock) BaseBarrelBlock(ru.bclib.blocks.BaseBarrelBlock)

Example 8 with FabricItemSettings

use of net.fabricmc.fabric.api.item.v1.FabricItemSettings in project BCLib by paulevsGitch.

the class WoodenComplexMaterial method initDecorations.

protected final void initDecorations(FabricBlockSettings blockSettings, FabricItemSettings itemSettings) {
    addBlockEntry(new BlockEntry(BLOCK_CRAFTING_TABLE, (complexMaterial, settings) -> new BaseCraftingTableBlock(getBlock(BLOCK_PLANKS))).setBlockTags(NamedCommonBlockTags.WORKBENCHES).setItemTags(NamedCommonItemTags.WORKBENCHES));
    addBlockEntry(new BlockEntry(BLOCK_BOOKSHELF, (complexMaterial, settings) -> new BaseBookshelfBlock(getBlock(BLOCK_PLANKS))).setBlockTags(NamedCommonBlockTags.BOOKSHELVES));
    addBlockEntry(new BlockEntry(BLOCK_COMPOSTER, (complexMaterial, settings) -> new BaseComposterBlock(getBlock(BLOCK_PLANKS))));
}
Also used : ResourceLocation(net.minecraft.resources.ResourceLocation) NamedItemTags(ru.bclib.api.tag.NamedItemTags) BaseChestBlock(ru.bclib.blocks.BaseChestBlock) BaseGateBlock(ru.bclib.blocks.BaseGateBlock) Items(net.minecraft.world.item.Items) BaseSlabBlock(ru.bclib.blocks.BaseSlabBlock) StripableBarkBlock(ru.bclib.blocks.StripableBarkBlock) TagLocation(ru.bclib.api.tag.TagAPI.TagLocation) Item(net.minecraft.world.item.Item) RecipeEntry(ru.bclib.complexmaterials.entry.RecipeEntry) BaseDoorBlock(ru.bclib.blocks.BaseDoorBlock) BaseCraftingTableBlock(ru.bclib.blocks.BaseCraftingTableBlock) MaterialColor(net.minecraft.world.level.material.MaterialColor) BaseTrapdoorBlock(ru.bclib.blocks.BaseTrapdoorBlock) WoodenPressurePlateBlock(ru.bclib.blocks.WoodenPressurePlateBlock) FabricItemSettings(net.fabricmc.fabric.api.item.v1.FabricItemSettings) BaseWoodenButtonBlock(ru.bclib.blocks.BaseWoodenButtonBlock) NamedBlockTags(ru.bclib.api.tag.NamedBlockTags) BaseStripableLogBlock(ru.bclib.blocks.BaseStripableLogBlock) NamedCommonBlockTags(ru.bclib.api.tag.NamedCommonBlockTags) TagAPI(ru.bclib.api.tag.TagAPI) NamedCommonItemTags(ru.bclib.api.tag.NamedCommonItemTags) BaseBarrelBlock(ru.bclib.blocks.BaseBarrelBlock) BaseSignBlock(ru.bclib.blocks.BaseSignBlock) FabricBlockSettings(net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings) BaseBarkBlock(ru.bclib.blocks.BaseBarkBlock) BCLib(ru.bclib.BCLib) BaseFenceBlock(ru.bclib.blocks.BaseFenceBlock) Blocks(net.minecraft.world.level.block.Blocks) BaseStairsBlock(ru.bclib.blocks.BaseStairsBlock) BaseBookshelfBlock(ru.bclib.blocks.BaseBookshelfBlock) BaseRotatedPillarBlock(ru.bclib.blocks.BaseRotatedPillarBlock) BaseBlock(ru.bclib.blocks.BaseBlock) BaseLadderBlock(ru.bclib.blocks.BaseLadderBlock) Block(net.minecraft.world.level.block.Block) GridRecipe(ru.bclib.recipes.GridRecipe) BaseComposterBlock(ru.bclib.blocks.BaseComposterBlock) BlockEntry(ru.bclib.complexmaterials.entry.BlockEntry) FlammableBlockRegistry(net.fabricmc.fabric.api.registry.FlammableBlockRegistry) BlockEntry(ru.bclib.complexmaterials.entry.BlockEntry) BaseBookshelfBlock(ru.bclib.blocks.BaseBookshelfBlock) BaseCraftingTableBlock(ru.bclib.blocks.BaseCraftingTableBlock) BaseComposterBlock(ru.bclib.blocks.BaseComposterBlock)

Example 9 with FabricItemSettings

use of net.fabricmc.fabric.api.item.v1.FabricItemSettings in project Terracraft by SimplyCmd.

the class BlockRegistry method register.

public static void register() {
    // Blocks
    hellstone_block = new SimpleBlock(ID("hellstone_block"), new Block(FabricBlockSettings.of(Material.METAL).strength(1.5f, 6.0f).requiresTool())).withItem(ItemModel.BLOCK, (block) -> new BlockItem(block, new FabricItemSettings().group(ItemGroup.BUILDING_BLOCKS)));
    grass_bale = new SimpleBlock(ID("grass_bale"), new HayBlock(FabricBlockSettings.of(Material.SOLID_ORGANIC, MapColor.PALE_GREEN).strength(0.5F).sounds(BlockSoundGroup.GRASS))).withItem(ItemModel.BLOCK, (block) -> new BlockItem(block, new FabricItemSettings().group(ItemGroup.BUILDING_BLOCKS)));
    dart_trap = new SimpleBlock(ID("dart_trap"), new DartTrapBlock(FabricBlockSettings.of(Material.STONE).strength(1.5f, 6.0f).requiresTool())).withItem(ItemModel.BLOCK, (block) -> new BlockItem(block, new FabricItemSettings().group(ItemGroup.REDSTONE)));
    blue_berry_bush = new SimpleBlock(ID("blue_berry_bush"), new BlueBerryBushBlock(FabricBlockSettings.of(Material.PLANT).ticksRandomly().noCollision().sounds(BlockSoundGroup.SWEET_BERRY_BUSH)));
    daybloom = new SimpleBlock(ID("daybloom"), new DaybloomBlock(FabricBlockSettings.of(Material.PLANT).ticksRandomly().noCollision().sounds(BlockSoundGroup.CROP)));
    life_crystal = new SimpleBlock(ID("life_crystal"), new Block(FabricBlockSettings.of(Material.AMETHYST, MapColor.BRIGHT_RED).sounds(BlockSoundGroup.LARGE_AMETHYST_BUD))).defaultBlockstate().withItem(ItemModel.ITEM, (block) -> new LifeCrystalBlockItem(block, new FabricItemSettings().group(ItemGroup.DECORATIONS)));
    ice_torch = torch("ice", ParticleTypes.SOUL_FIRE_FLAME, tr(Items.ICE));
    bone_torch = torch("bone", ParticleTypes.SOUL_FIRE_FLAME, tr(Items.BONE));
    ultrabright_torch = torch("ultrabright", ParticleTypes.SOUL_FIRE_FLAME, tr(Items.GLOW_BERRIES));
    demon_torch = torch("demon", ParticleTypes.SOUL_FIRE_FLAME, tr(Items.GHAST_TEAR));
    cursed_torch = torch("cursed", ParticleTypes.SOUL_FIRE_FLAME, tr(Items.PHANTOM_MEMBRANE));
    ichor_torch = torch("ichor", ParticleTypes.SOUL_FIRE_FLAME, tr(Items.DANDELION));
    rainbow_torch = torch("rainbow", ParticleTypes.SOUL_FIRE_FLAME, tr(Items.PRISMARINE_SHARD));
    desert_torch = torch("desert", ParticleTypes.SOUL_FIRE_FLAME, tr(Items.SANDSTONE));
    coral_torch = torch("coral", ParticleTypes.SOUL_FIRE_FLAME, tr(Items.SEA_PICKLE));
    corrupt_torch = torch("corrupt", ParticleTypes.SOUL_FIRE_FLAME, tr(Items.BLACKSTONE));
    crimson_torch = torch("crimson", ParticleTypes.SOUL_FIRE_FLAME, tr(Items.NETHER_WART));
    hallowed_torch = torch("hallowed", ParticleTypes.SOUL_FIRE_FLAME, tr(Items.SWEET_BERRIES));
    jungle_torch = torch("jungle", ParticleTypes.SOUL_FIRE_FLAME, tr(Items.BAMBOO));
    forest_pot = new SimpleBlock(ID("forest_pot"), new PotBlock(4, 1 / 500.0, Items.TORCH, 1.0F)).withItem(ItemModel.BLOCK, (block) -> new BlockItem(block, new FabricItemSettings().group(ItemGroup.DECORATIONS)));
    tundra_pot = new SimpleBlock(ID("tundra_pot"), new PotBlock(3, 1 / 461.0, BlockRegistry.ice_torch.getItem().getItem(), 1.25F)).withItem(ItemModel.BLOCK, (block) -> new BlockItem(block, new FabricItemSettings().group(ItemGroup.DECORATIONS)));
    jungle_pot = new SimpleBlock(ID("jungle_pot"), new PotBlock(3, 1 / 400.0, BlockRegistry.jungle_torch.getItem().getItem(), 1.75F)).withItem(ItemModel.BLOCK, (block) -> new BlockItem(block, new FabricItemSettings().group(ItemGroup.DECORATIONS)));
    dungeon_pot = new SimpleBlock(ID("dungeon_pot"), new PotBlock(3, 1 / 384.0, Items.TORCH, 1.9F)).withItem(ItemModel.BLOCK, (block) -> new BlockItem(block, new FabricItemSettings().group(ItemGroup.DECORATIONS)));
    underworld_pot = new SimpleBlock(ID("underworld_pot"), new PotBlock(3, 1 / 365.0, Items.TORCH, 2.1F)).withItem(ItemModel.BLOCK, (block) -> new BlockItem(block, new FabricItemSettings().group(ItemGroup.DECORATIONS)));
    corrupt_pot = new SimpleBlock(ID("corrupt_pot"), new PotBlock(3, 1 / 365.0, BlockRegistry.corrupt_torch.getItem().getItem(), 1.6F)).withItem(ItemModel.BLOCK, (block) -> new BlockItem(block, new FabricItemSettings().group(ItemGroup.DECORATIONS)));
    crimson_pot = new SimpleBlock(ID("crimson_pot"), new PotBlock(3, 1 / 365.0, BlockRegistry.crimson_torch.getItem().getItem(), 1.6F)).withItem(ItemModel.BLOCK, (block) -> new BlockItem(block, new FabricItemSettings().group(ItemGroup.DECORATIONS)));
    hallowed_pot = new SimpleBlock(ID("hallowed_pot"), new PotBlock(3, 1 / 365.0, BlockRegistry.hallowed_torch.getItem().getItem(), 1.6F)).withItem(ItemModel.BLOCK, (block) -> new BlockItem(block, new FabricItemSettings().group(ItemGroup.DECORATIONS)));
    spider_pot = new SimpleBlock(ID("spider_pot"), new PotBlock(3, 1 / 272.0, Items.TORCH, 3.5F)).withItem(ItemModel.BLOCK, (block) -> new BlockItem(block, new FabricItemSettings().group(ItemGroup.DECORATIONS)));
    pyramid_pot = new SimpleBlock(ID("pyramid_pot"), new PotBlock(3, 1 / 125.0, Items.TORCH, 10.0F)).withItem(ItemModel.BLOCK, (block) -> new BlockItem(block, new FabricItemSettings().group(ItemGroup.DECORATIONS)));
    lihzahrd_pot = // TODO: Portal values are 1/250 for hm and 1/500 for pre-hm AND modifier is 4.0F hm and 1.0F pre-hm
    new SimpleBlock(ID("lihzahrd_pot"), new PotBlock(3, 1 / 250.0, Items.TORCH, 4.0F)).withItem(ItemModel.BLOCK, (block) -> new BlockItem(block, new FabricItemSettings().group(ItemGroup.DECORATIONS)));
    marble_pot = new SimpleBlock(ID("marble_pot"), new PotBlock(3, 1 / 375.0, Items.TORCH, 2.0F)).withItem(ItemModel.BLOCK, (block) -> new BlockItem(block, new FabricItemSettings().group(ItemGroup.DECORATIONS)));
    desert_pot = new SimpleBlock(ID("desert_pot"), new PotBlock(3, 1 / 461.0, BlockRegistry.desert_torch.getItem().getItem(), 1.25F)).withItem(ItemModel.BLOCK, (block) -> new BlockItem(block, new FabricItemSettings().group(ItemGroup.DECORATIONS)));
}
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) LifeCrystalBlockItem(io.github.simplycmd.terracraft.blocks.items.LifeCrystalBlockItem) FabricItemSettings(net.fabricmc.fabric.api.item.v1.FabricItemSettings) SimpleBlock(com.simplycmd.featherlib.registry.SimpleBlock) LifeCrystalBlockItem(io.github.simplycmd.terracraft.blocks.items.LifeCrystalBlockItem)

Example 10 with FabricItemSettings

use of net.fabricmc.fabric.api.item.v1.FabricItemSettings 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

FabricItemSettings (net.fabricmc.fabric.api.item.v1.FabricItemSettings)22 Identifier (net.minecraft.util.Identifier)12 BlockItem (net.minecraft.item.BlockItem)9 FabricBlockSettings (net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings)6 ResourceLocation (net.minecraft.resources.ResourceLocation)4 Item (net.minecraft.world.item.Item)4 Block (net.minecraft.world.level.block.Block)4 SimpleItem (com.simplycmd.featherlib.registry.SimpleItem)3 FlammableBlockRegistry (net.fabricmc.fabric.api.registry.FlammableBlockRegistry)3 Items (net.minecraft.world.item.Items)3 Blocks (net.minecraft.world.level.block.Blocks)3 MaterialColor (net.minecraft.world.level.material.MaterialColor)3 BCLib (ru.bclib.BCLib)3 NamedBlockTags (ru.bclib.api.tag.NamedBlockTags)3 NamedCommonBlockTags (ru.bclib.api.tag.NamedCommonBlockTags)3 NamedCommonItemTags (ru.bclib.api.tag.NamedCommonItemTags)3 NamedItemTags (ru.bclib.api.tag.NamedItemTags)3 TagAPI (ru.bclib.api.tag.TagAPI)3 TagLocation (ru.bclib.api.tag.TagAPI.TagLocation)3 BaseBarkBlock (ru.bclib.blocks.BaseBarkBlock)3