Search in sources :

Example 1 with HoneycombBlock

use of com.teamresourceful.resourcefulbees.block.HoneycombBlock in project ResourcefulBees by Resourceful-Bees.

the class ColorHandler method onItemColors.

public static void onItemColors(ColorHandlerEvent.Item event) {
    ItemColors colors = event.getItemColors();
    BEE_REGISTRY.getBees().forEach(((s, beeData) -> {
        HoneycombData honeycombData = beeData.getHoneycombData();
        if (honeycombData.getHoneycombType().equals(HoneycombType.DEFAULT) && !honeycombData.getColor().isDefault()) {
            registerItems(colors, HoneycombItem::getColor, BeeInfoUtils.getItem(ResourcefulBees.MOD_ID + ":" + s + "_honeycomb"));
            registerItems(colors, HoneycombBlock::getItemColor, BeeInfoUtils.getItem(ResourcefulBees.MOD_ID + ":" + s + "_honeycomb_block"));
        }
        if (!beeData.getRenderData().getColorData().getSpawnEggPrimaryColor().isDefault() && !beeData.getRenderData().getColorData().getSpawnEggSecondaryColor().isDefault()) {
            registerItems(colors, BeeSpawnEggItem::getColor, BeeInfoUtils.getItem(ResourcefulBees.MOD_ID + ":" + s + "_bee_spawn_egg"));
        }
    }));
    HoneyRegistry.getRegistry().getHoneyBottles().forEach((h, honeyData) -> {
        registerItems(colors, CustomHoneyBottleItem::getColor, honeyData.getHoneyBottleRegistryObject().get());
        if (Config.HONEY_GENERATE_BLOCKS.get() && honeyData.doGenerateHoneyBlock()) {
            registerItems(colors, CustomHoneyBlock::getItemColor, honeyData.getHoneyBlockItemRegistryObject().get());
        }
        if (Config.HONEY_GENERATE_FLUIDS.get() && honeyData.doGenerateHoneyFluid()) {
            registerItems(colors, CustomHoneyBucketItem::getColor, honeyData.getHoneyBucketItemRegistryObject().get());
        }
    });
    registerItems(colors, BeeJar::getColor, ModItems.BEE_JAR.get());
}
Also used : BlockColor(net.minecraft.client.color.block.BlockColor) CustomHoneyBlock(com.teamresourceful.resourcefulbees.block.CustomHoneyBlock) Config(com.teamresourceful.resourcefulbees.config.Config) HoneycombType(com.teamresourceful.resourcefulbees.lib.enums.HoneycombType) BeeInfoUtils(com.teamresourceful.resourcefulbees.utils.BeeInfoUtils) ModItems(com.teamresourceful.resourcefulbees.registry.ModItems) HoneyRegistry(com.teamresourceful.resourcefulbees.registry.HoneyRegistry) HoneycombBlock(com.teamresourceful.resourcefulbees.block.HoneycombBlock) LOGGER(com.teamresourceful.resourcefulbees.ResourcefulBees.LOGGER) com.teamresourceful.resourcefulbees.item(com.teamresourceful.resourcefulbees.item) ItemColors(net.minecraft.client.color.item.ItemColors) BeeRegistry(com.teamresourceful.resourcefulbees.registry.BeeRegistry) ItemLike(net.minecraft.world.level.ItemLike) HoneycombData(com.teamresourceful.resourcefulbees.api.beedata.HoneycombData) BlockColors(net.minecraft.client.color.block.BlockColors) ResourcefulBees(com.teamresourceful.resourcefulbees.ResourcefulBees) Block(net.minecraft.world.level.block.Block) IBeeRegistry(com.teamresourceful.resourcefulbees.api.IBeeRegistry) ColorHandlerEvent(net.minecraftforge.client.event.ColorHandlerEvent) ItemColor(net.minecraft.client.color.item.ItemColor) HoneycombData(com.teamresourceful.resourcefulbees.api.beedata.HoneycombData) ItemColors(net.minecraft.client.color.item.ItemColors) CustomHoneyBlock(com.teamresourceful.resourcefulbees.block.CustomHoneyBlock)

Example 2 with HoneycombBlock

use of com.teamresourceful.resourcefulbees.block.HoneycombBlock in project ResourcefulBees by Resourceful-Bees.

the class RegistryHandler method registerHoneycomb.

private static void registerHoneycomb(String name, HoneycombData honeycombData) {
    final RegistryObject<Block> customHoneycombBlock = ModBlocks.BLOCKS.register(name + "_honeycomb_block", () -> new HoneycombBlock(name, honeycombData, BlockBehaviour.Properties.copy(Blocks.HONEYCOMB_BLOCK)));
    ModItems.ITEMS.register(name + "_honeycomb", () -> new HoneycombItem(name, honeycombData, new Item.Properties().tab(ItemGroupResourcefulBees.RESOURCEFUL_BEES)));
    ModItems.ITEMS.register(name + "_honeycomb_block", () -> new BlockItem(customHoneycombBlock.get(), new Item.Properties().tab(ItemGroupResourcefulBees.RESOURCEFUL_BEES)));
}
Also used : Item(net.minecraft.world.item.Item) CustomHoneyBottleItem(com.teamresourceful.resourcefulbees.item.CustomHoneyBottleItem) BlockItem(net.minecraft.world.item.BlockItem) CustomHoneyBucketItem(com.teamresourceful.resourcefulbees.item.CustomHoneyBucketItem) BeeSpawnEggItem(com.teamresourceful.resourcefulbees.item.BeeSpawnEggItem) HoneycombItem(com.teamresourceful.resourcefulbees.item.HoneycombItem) HoneycombBlock(com.teamresourceful.resourcefulbees.block.HoneycombBlock) HoneycombItem(com.teamresourceful.resourcefulbees.item.HoneycombItem) LiquidBlock(net.minecraft.world.level.block.LiquidBlock) CustomHoneyFluidBlock(com.teamresourceful.resourcefulbees.block.CustomHoneyFluidBlock) CustomHoneyBlock(com.teamresourceful.resourcefulbees.block.CustomHoneyBlock) HoneycombBlock(com.teamresourceful.resourcefulbees.block.HoneycombBlock) DispenserBlock(net.minecraft.world.level.block.DispenserBlock) Block(net.minecraft.world.level.block.Block) BlockItem(net.minecraft.world.item.BlockItem)

Example 3 with HoneycombBlock

use of com.teamresourceful.resourcefulbees.block.HoneycombBlock in project ResourcefulBees by Resourceful-Bees.

the class ColorHandler method onBlockColors.

public static void onBlockColors(ColorHandlerEvent.Block event) {
    BlockColors colors = event.getBlockColors();
    BEE_REGISTRY.getBees().forEach(((s, beeData) -> {
        HoneycombData honeycombData = beeData.getHoneycombData();
        if (honeycombData.getHoneycombType().equals(HoneycombType.DEFAULT) && (!honeycombData.getColor().isDefault())) {
            registerBlocks(colors, HoneycombBlock::getBlockColor, BeeInfoUtils.getBlock(ResourcefulBees.MOD_ID + ":" + s + "_honeycomb_block"));
        }
    }));
    HoneyRegistry.getRegistry().getHoneyBottles().forEach((h, honeyData) -> {
        if (Config.HONEY_GENERATE_BLOCKS.get() && honeyData.doGenerateHoneyBlock()) {
            registerBlocks(colors, CustomHoneyBlock::getBlockColor, honeyData.getHoneyBlockRegistryObject().get());
        }
    });
}
Also used : BlockColor(net.minecraft.client.color.block.BlockColor) CustomHoneyBlock(com.teamresourceful.resourcefulbees.block.CustomHoneyBlock) Config(com.teamresourceful.resourcefulbees.config.Config) HoneycombType(com.teamresourceful.resourcefulbees.lib.enums.HoneycombType) BeeInfoUtils(com.teamresourceful.resourcefulbees.utils.BeeInfoUtils) ModItems(com.teamresourceful.resourcefulbees.registry.ModItems) HoneyRegistry(com.teamresourceful.resourcefulbees.registry.HoneyRegistry) HoneycombBlock(com.teamresourceful.resourcefulbees.block.HoneycombBlock) LOGGER(com.teamresourceful.resourcefulbees.ResourcefulBees.LOGGER) com.teamresourceful.resourcefulbees.item(com.teamresourceful.resourcefulbees.item) ItemColors(net.minecraft.client.color.item.ItemColors) BeeRegistry(com.teamresourceful.resourcefulbees.registry.BeeRegistry) ItemLike(net.minecraft.world.level.ItemLike) HoneycombData(com.teamresourceful.resourcefulbees.api.beedata.HoneycombData) BlockColors(net.minecraft.client.color.block.BlockColors) ResourcefulBees(com.teamresourceful.resourcefulbees.ResourcefulBees) Block(net.minecraft.world.level.block.Block) IBeeRegistry(com.teamresourceful.resourcefulbees.api.IBeeRegistry) ColorHandlerEvent(net.minecraftforge.client.event.ColorHandlerEvent) ItemColor(net.minecraft.client.color.item.ItemColor) HoneycombData(com.teamresourceful.resourcefulbees.api.beedata.HoneycombData) CustomHoneyBlock(com.teamresourceful.resourcefulbees.block.CustomHoneyBlock) BlockColors(net.minecraft.client.color.block.BlockColors)

Aggregations

CustomHoneyBlock (com.teamresourceful.resourcefulbees.block.CustomHoneyBlock)3 HoneycombBlock (com.teamresourceful.resourcefulbees.block.HoneycombBlock)3 Block (net.minecraft.world.level.block.Block)3 ResourcefulBees (com.teamresourceful.resourcefulbees.ResourcefulBees)2 LOGGER (com.teamresourceful.resourcefulbees.ResourcefulBees.LOGGER)2 IBeeRegistry (com.teamresourceful.resourcefulbees.api.IBeeRegistry)2 HoneycombData (com.teamresourceful.resourcefulbees.api.beedata.HoneycombData)2 Config (com.teamresourceful.resourcefulbees.config.Config)2 com.teamresourceful.resourcefulbees.item (com.teamresourceful.resourcefulbees.item)2 HoneycombType (com.teamresourceful.resourcefulbees.lib.enums.HoneycombType)2 BeeRegistry (com.teamresourceful.resourcefulbees.registry.BeeRegistry)2 HoneyRegistry (com.teamresourceful.resourcefulbees.registry.HoneyRegistry)2 ModItems (com.teamresourceful.resourcefulbees.registry.ModItems)2 BeeInfoUtils (com.teamresourceful.resourcefulbees.utils.BeeInfoUtils)2 BlockColor (net.minecraft.client.color.block.BlockColor)2 BlockColors (net.minecraft.client.color.block.BlockColors)2 ItemColor (net.minecraft.client.color.item.ItemColor)2 ItemColors (net.minecraft.client.color.item.ItemColors)2 ItemLike (net.minecraft.world.level.ItemLike)2 ColorHandlerEvent (net.minecraftforge.client.event.ColorHandlerEvent)2