-
Notifications
You must be signed in to change notification settings - Fork 1
/
ModBlocks.java
52 lines (45 loc) · 1.7 KB
/
ModBlocks.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package thatmartinguy.thedarkness.init;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
import thatmartinguy.thedarkness.block.*;
import thatmartinguy.thedarkness.tileentity.TileEntityHidden;
@EventBusSubscriber
public class ModBlocks
{
public static BlockHidden blockHidden;
public static BlockBase blockSeeThrough;
public static final Block[] BLOCKS = {
blockHidden = new BlockHidden("blockHidden", Material.AIR),
blockSeeThrough = new BlockSeeThrough("blockSeeThrough", Material.STRUCTURE_VOID)
};
public static final Class<? extends TileEntity>[] TILE_ENTITIES = new Class[]{
TileEntityHidden.class
};
@SubscribeEvent
public static void registerBlocks(RegistryEvent.Register<Block> event)
{
event.getRegistry().registerAll(BLOCKS);
}
@SubscribeEvent
public static void registerItemBlocks(RegistryEvent.Register<Item> event)
{
for(Block block : BLOCKS)
{
event.getRegistry().register(new ItemBlock(block).setUnlocalizedName(block.getUnlocalizedName()).setRegistryName(block.getRegistryName()));
}
}
public static void registerTileEntities()
{
for(Class<? extends TileEntity> tileEntity : TILE_ENTITIES)
{
GameRegistry.registerTileEntity(tileEntity, "tileEntityHidden");
}
}
}