Created
November 12, 2016 12:49
-
-
Save Arjol27/de2b02d666f69697e65c63e62da9b50c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.da.blocks; | |
import net.minecraft.block.Block; | |
import net.minecraft.block.material.Material; | |
import net.minecraft.item.ItemBlock; | |
import net.minecraftforge.event.RegistryEvent; | |
import net.minecraftforge.fml.common.Mod; | |
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | |
import net.minecraftforge.fml.common.registry.GameRegistry; | |
import net.minecraftforge.fml.common.registry.IForgeRegistry; | |
@Mod.EventBusSubscriber | |
public class BlockRegistry { | |
public static Block altarCore = new altarCore(Material.GROUND); | |
//public static ItemBlock altarCoreIB = (ItemBlock) new ItemBlock(altarCore).setRegistryName("altarCore"); | |
@SubscribeEvent | |
public static void registerBlocks(RegistryEvent.Register<Block> event){ | |
IForgeRegistry registry = event.getRegistry(); | |
registry.register(altarCore); | |
registerItemBlock(altarCore); | |
} | |
public static void registerItemBlock(Block block){ | |
ItemBlock item = new ItemBlock(block); | |
item.setRegistryName(block.getRegistryName()); | |
GameRegistry.register(item); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment