Search in sources :

Example 1 with Properties

use of net.minecraft.world.level.block.state.BlockBehaviour.Properties in project Totemic by TeamTotemic.

the class ModBlocks method init.

@SubscribeEvent
public static void init(RegistryEvent.Register<Block> event) {
    internallyRegisterTotemEffects();
    for (TotemWoodType woodType : TotemWoodType.getWoodTypes()) {
        Properties blockProperties = Properties.of(Material.WOOD, woodType.getWoodColor()).strength(2, 5).sound(SoundType.WOOD);
        TotemBaseBlock totemBase = new TotemBaseBlock(woodType, blockProperties);
        totemBase.setRegistryName(Totemic.MOD_ID, woodType.getName() + "_totem_base");
        event.getRegistry().register(totemBase);
        totemBases.put(woodType, totemBase);
        blocksWithItemBlock.add(totemBase);
        for (TotemEffect totemEffect : totemEffectsToRegister) {
            TotemPoleBlock totemPole = new TotemPoleBlock(woodType, totemEffect, blockProperties);
            totemPole.setRegistryName(Totemic.MOD_ID, woodType.getName() + "_totem_pole_" + totemEffect.getRegistryName().getPath());
            event.getRegistry().register(totemPole);
            totemPoles.put(woodType, totemEffect, totemPole);
            blocksWithItemBlock.add(totemPole);
        }
    }
}
Also used : TotemWoodType(pokefenn.totemic.api.TotemWoodType) Properties(net.minecraft.world.level.block.state.BlockBehaviour.Properties) TotemEffect(pokefenn.totemic.api.totem.TotemEffect) TotemBaseBlock(pokefenn.totemic.block.totem.TotemBaseBlock) TotemPoleBlock(pokefenn.totemic.block.totem.TotemPoleBlock) SubscribeEvent(net.minecraftforge.eventbus.api.SubscribeEvent)

Aggregations

Properties (net.minecraft.world.level.block.state.BlockBehaviour.Properties)1 SubscribeEvent (net.minecraftforge.eventbus.api.SubscribeEvent)1 TotemWoodType (pokefenn.totemic.api.TotemWoodType)1 TotemEffect (pokefenn.totemic.api.totem.TotemEffect)1 TotemBaseBlock (pokefenn.totemic.block.totem.TotemBaseBlock)1 TotemPoleBlock (pokefenn.totemic.block.totem.TotemPoleBlock)1