41 lines
2.2 KiB
Java
41 lines
2.2 KiB
Java
package com.r3944realms.modernlifepatch.content.blocks;
|
|
|
|
import com.r3944realms.modernlifepatch.ModernLifePatch;
|
|
import com.r3944realms.modernlifepatch.content.blocks.type.mirror.MirrorBlock;
|
|
import com.r3944realms.modernlifepatch.content.blocks.type.mirror.MirrorPart;
|
|
import com.r3944realms.modernlifepatch.content.item.ModItems;
|
|
import net.minecraft.world.item.BlockItem;
|
|
import net.minecraft.world.item.Item;
|
|
import net.minecraft.world.level.block.Block;
|
|
import net.minecraft.world.level.block.Blocks;
|
|
import net.minecraft.world.level.block.state.BlockBehaviour;
|
|
import net.minecraftforge.eventbus.api.IEventBus;
|
|
import net.minecraftforge.registries.DeferredRegister;
|
|
import net.minecraftforge.registries.ForgeRegistries;
|
|
import net.minecraftforge.registries.RegistryObject;
|
|
|
|
import java.util.Collection;
|
|
|
|
public class ModBlocks {
|
|
private static final DeferredRegister<Block> BLOCKS
|
|
= DeferredRegister.create(ForgeRegistries.BLOCKS, ModernLifePatch.MOD_ID);
|
|
public static final RegistryObject<MirrorBlock> MIRROR = BLOCKS.register("mirror",
|
|
() -> new MirrorBlock(BlockBehaviour.Properties.copy(Blocks.GLASS), MirrorPart.MirrorType.COMMON_MIRROR));
|
|
public static final RegistryObject<MirrorBlock> TALL_MIRROR = BLOCKS.register("tall_mirror",
|
|
() -> new MirrorBlock(BlockBehaviour.Properties.copy(Blocks.GLASS), MirrorPart.MirrorType.TELL_MIRROR));
|
|
public static final RegistryObject<MirrorBlock> LARGE_MIRROR= BLOCKS.register("large_mirror",
|
|
() -> new MirrorBlock(BlockBehaviour.Properties.copy(Blocks.GLASS), MirrorPart.MirrorType.LARGE_MIRROR));
|
|
public static final RegistryObject<MirrorBlock> MASSIVE_MIRROR = BLOCKS.register("massive_mirror" ,
|
|
() -> new MirrorBlock(BlockBehaviour.Properties.copy(Blocks.GLASS), MirrorPart.MirrorType.MASSIVE_MIRROR));
|
|
@SuppressWarnings("UnusedReturnValue")
|
|
public static <T extends Block> RegistryObject<BlockItem> registerBlockItem(String name , RegistryObject<T> block){
|
|
return ModItems.register(name,() -> new BlockItem(block.get(),new Item.Properties()));
|
|
}
|
|
public static Collection<RegistryObject<Block>> getEntries() {
|
|
return BLOCKS.getEntries();
|
|
}
|
|
public static void register(IEventBus bus) {
|
|
BLOCKS.register(bus);
|
|
}
|
|
}
|