Skip to content

Instantly share code, notes, and snippets.

Created March 18, 2016 16:55
Show Gist options
  • Save anonymous/41b4bf082f2d980e7f74 to your computer and use it in GitHub Desktop.
Save anonymous/41b4bf082f2d980e7f74 to your computer and use it in GitHub Desktop.
package hubbard.trueminecraftmachines.init;
import hubbard.trueminecraftmachines.blocks.Machines.blockGrinder;
import hubbard.trueminecraftmachines.main.Reference;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.registry.GameRegistry;
public class Block_List
{
public static Block grinder;
public static void init()
{
grinder = new blockGrinder().setUnlocalizedName("grinder");
}
public static void register()
{
GameRegistry.registerBlock(grinder, grinder.getUnlocalizedName().substring(5));
}
public static void registerRenders()
{
registerRender(grinder);
}
public static void registerRender(Block block)
{
Item item = Item.getItemFromBlock(block);
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment