Jump to content

Recommended Posts

Posted

BlockTnt.java

Spoiler

package com.planetbravo.mainmod;

 

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.block.properties.IProperty;

import net.minecraft.block.properties.PropertyBool;

import net.minecraft.block.state.BlockStateContainer;

import net.minecraft.block.state.IBlockState;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.entity.Entity;

import net.minecraft.entity.EntityLivingBase;

import net.minecraft.entity.item.EntityTNTPrimed;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.entity.projectile.EntityArrow;

import net.minecraft.init.Blocks;

import net.minecraft.init.Items;

import net.minecraft.init.SoundEvents;

import net.minecraft.item.ItemStack;

import net.minecraft.util.EnumFacing;

import net.minecraft.util.EnumHand;

import net.minecraft.util.SoundCategory;

import net.minecraft.util.math.BlockPos;

import net.minecraft.world.Explosion;

import net.minecraft.world.World;

 

public class BlockTnt extends Block

{

    public static final PropertyBool EXPLODE = PropertyBool.create("explode");

 

    public BlockTnt(String string)

    {

        super(Material.TNT);

        this.setDefaultState(this.blockState.getBaseState().withProperty(EXPLODE, Boolean.valueOf(false)));

        this.setCreativeTab(CreativeTabs.REDSTONE);

    }

 

    /**

     * Called after the block is set in the Chunk data, but before the Tile Entity is set

     */

    public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state)

    {

        super.onBlockAdded(worldIn, pos, state);

 

        if (worldIn.isBlockPowered(pos))

        {

            this.onBlockDestroyedByPlayer(worldIn, pos, state.withProperty(EXPLODE, Boolean.valueOf(true)));

            worldIn.setBlockToAir(pos);

        }

    }

 

    /**

     * Called when a neighboring block was changed and marks that this state should perform any checks during a neighbor

     * change. Cases may include when redstone power is updated, cactus blocks popping off due to a neighboring solid

     * block, etc.

     */

    public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos)

    {

        if (worldIn.isBlockPowered(pos))

        {

            this.onBlockDestroyedByPlayer(worldIn, pos, state.withProperty(EXPLODE, Boolean.valueOf(true)));

            worldIn.setBlockToAir(pos);

        }

    }

 

    /**

     * Called when this Block is destroyed by an Explosion

     */

    public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn)

    {

        if (!worldIn.isRemote)

        {

            EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(worldIn, (double)((float)pos.getX() + 0.5F), (double)pos.getY(), (double)((float)pos.getZ() + 0.5F), explosionIn.getExplosivePlacedBy());

            entitytntprimed.setFuse((short)(worldIn.rand.nextInt(entitytntprimed.getFuse() / 4) + entitytntprimed.getFuse() / 8));

            worldIn.spawnEntity(entitytntprimed);

        }

    }

 

    /**

     * Called when a player destroys this Block

     */

    public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, IBlockState state)

    {

        this.explode(worldIn, pos, state, (EntityLivingBase)null);

    }

 

    public void explode(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase igniter)

    {

        if (!worldIn.isRemote)

        {

            if (((Boolean)state.getValue(EXPLODE)).booleanValue())

            {

                EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(worldIn, (double)((float)pos.getX() + 0.5F), (double)pos.getY(), (double)((float)pos.getZ() + 0.5F), igniter);

                worldIn.spawnEntity(entitytntprimed);

                worldIn.playSound((EntityPlayer)null, entitytntprimed.posX, entitytntprimed.posY, entitytntprimed.posZ, SoundEvents.ENTITY_TNT_PRIMED, SoundCategory.BLOCKS, 1.0F, 1.0F);

            }

        }

    }

 

    /**

     * Called when the block is right clicked by a player.

     */

    public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)

    {

        ItemStack itemstack = playerIn.getHeldItem(hand);

 

        if (!itemstack.isEmpty() && (itemstack.getItem() == Items.FLINT_AND_STEEL || itemstack.getItem() == Items.FIRE_CHARGE))

        {

            this.explode(worldIn, pos, state.withProperty(EXPLODE, Boolean.valueOf(true)), playerIn);

            worldIn.setBlockState(pos, Blocks.AIR.getDefaultState(), 11);

 

            if (itemstack.getItem() == Items.FLINT_AND_STEEL)

            {

                itemstack.damageItem(1, playerIn);

            }

            else if (!playerIn.capabilities.isCreativeMode)

            {

                itemstack.shrink(1);

            }

 

            return true;

        }

        else

        {

            return super.onBlockActivated(worldIn, pos, state, playerIn, hand, facing, hitX, hitY, hitZ);

        }

    }

 

    /**

     * Called When an Entity Collided with the Block

     */

    public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn)

    {

        if (!worldIn.isRemote && entityIn instanceof EntityArrow)

        {

            EntityArrow entityarrow = (EntityArrow)entityIn;

 

            if (entityarrow.isBurning())

            {

                this.explode(worldIn, pos, worldIn.getBlockState(pos).withProperty(EXPLODE, Boolean.valueOf(true)), entityarrow.shootingEntity instanceof EntityLivingBase ? (EntityLivingBase)entityarrow.shootingEntity : null);

                worldIn.setBlockToAir(pos);

            }

        }

    }

 

    /**

     * Return whether this block can drop from an explosion.

     */

    public boolean canDropFromExplosion(Explosion explosionIn)

    {

        return false;

    }

 

    /**

     * Convert the given metadata into a BlockState for this Block

     */

    public IBlockState getStateFromMeta(int meta)

    {

        return this.getDefaultState().withProperty(EXPLODE, Boolean.valueOf((meta & 1) > 0));

    }

 

    /**

     * Convert the BlockState into the correct metadata value

     */

    public int getMetaFromState(IBlockState state)

    {

        return ((Boolean)state.getValue(EXPLODE)).booleanValue() ? 1 : 0;

    }

 

    protected BlockStateContainer createBlockState()

    {

        return new BlockStateContainer(this, new IProperty[] {EXPLODE});

    }

}

Register.java

Spoiler

package com.planetbravo.mainmod;

import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.registry.GameRegistry;

public final class Register {

    public static String modid = Main.MODID;

    public static Block blockone;
    public static Block blocktwo;
    public static Block blockthree;
    public static Block blockfour;
    public static Block blockfive;
    public static Block blocksix;
    public static Block blockseven;
    public static Block blockeight;
    public static Block blocknine;
    public static Block blockten;
    public static Block blockeleven;
    public static Block blocktwelve;
    public static Block blockthirteen;
    public static Block blockfourteen;
    public static Block blockfifteen;
    public static Block blocksixteen;
    public static Block blockeightteen;
    public static Block blockpilot;
    public static Block blocktnt;
    public static WorldGen genone;
    public static Item itemone;
    public static Item itemtwo;
    public static Item itemthree;
    public static Item itemfour;
    public static Item itemfive;
    public static Item itemsix;
    public static Item itemseven;
    public static Item itemeight;
    public static Item itemnine;
    public static Item itemten;
    public static Item itemeleven;
    public static Item itemtwelve;
    public static Item itemthirteen;
    public static Item itemfourteen;
    public static Item itemfifteen;
    public static Item itemsixteen;
    public static Item itemeightteen;
    public static ArmorMaterial ARMORONE = EnumHelper.addArmorMaterial("armorone", "mainmod:armorone", 16, new int[] {3, 5, 4, 3}, 30, null, 0);
    public static Item armorhelmetone;
    public static Item armorchestplateone;
    public static Item armorleggingsone;
    public static Item armorbootsone;
    public static ArmorMaterial ARMORTWO = EnumHelper.addArmorMaterial("armortwo", "mainmod:armortwo", 16, new int[] {2, 4, 3, 2}, 30, null, 0);
    public static Item armorhelmettwo;
    public static Item armorchestplatetwo;
    public static Item armorleggingstwo;
    public static Item armorbootstwo;
    public static CreativeTabs mainTab = new MainTab("meatModMenu");

    public static void addRecipes() {
        GameRegistry.addRecipe(new ItemStack(blocktwo, 1), new Object[] {
                "DDD",
                "DDD",
                "DDD",
                'D', itemone
            });
        
        GameRegistry.addRecipe(new ItemStack(blockthree, 1), new Object[] {
                "DDD",
                "DDD",
                "DDD",
                'D', Items.CHICKEN
            });
        
        GameRegistry.addRecipe(new ItemStack(blockfour, 1), new Object[] {
                "DDD",
                "DDD",
                "DDD",
                'D', blockthree
            });
        
        GameRegistry.addRecipe(new ItemStack(blockfive, 1), new Object[] {
                "DDD",
                "DDD",
                "DDD",
                'D', Items.COOKED_CHICKEN
            });
        
        GameRegistry.addRecipe(new ItemStack(blocksix, 1), new Object[] {
                "DDD",
                "DDD",
                "DDD",
                'D', blockfive
            });
        
        GameRegistry.addRecipe(new ItemStack(blockseven, 1), new Object[] {
                "EDE",
                "DED",
                "EDE",
                'D', Items.PORKCHOP, 'E', Items.BEEF
            });
        
        GameRegistry.addRecipe(new ItemStack(blockeight, 1), new Object[] {
                "DDD",
                "DDD",
                "DDD",
                'D', blockseven
            });
        
        GameRegistry.addRecipe(new ItemStack(blocknine, 1), new Object[] {
                "EDE",
                "DED",
                "EDE",
                'D', Items.COOKED_PORKCHOP, 'E', Items.COOKED_BEEF
            });
        
        GameRegistry.addRecipe(new ItemStack(blockten, 1), new Object[] {
                "DDD",
                "DDD",
                "DDD",
                'D', blocknine
            });
        
        GameRegistry.addRecipe(new ItemStack(blocktwelve, 1), new Object[] {
                "DDD",
                "DDD",
                "DDD",
                'D', Items.FISH
            });
        
        GameRegistry.addRecipe(new ItemStack(blockfourteen, 1), new Object[] {
                "DDD",
                "DDD",
                "DDD",
                'D', blocktwelve
            });
        
        GameRegistry.addRecipe(new ItemStack(blockthirteen, 1), new Object[] {
                "DDD",
                "DDD",
                "DDD",
                'D', Items.COOKED_FISH
            });
        
        GameRegistry.addRecipe(new ItemStack(blockfifteen, 1), new Object[] {
                "DDD",
                "DDD",
                "DDD",
                'D', blockthirteen
            });
        
        GameRegistry.addRecipe(new ItemStack(blocksixteen, 1), new Object[] {
                "DDD",
                "DDD",
                "DDD",
                'D', itemfour
            });
        
        GameRegistry.addRecipe(new ItemStack(blockeightteen, 1), new Object[] {
                "DDD",
                "DDD",
                "DDD",
                'D', blocksixteen
            });
        
        GameRegistry.addRecipe(new ItemStack(blocksixteen, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', blockeightteen
            });
        
        GameRegistry.addRecipe(new ItemStack(itemfour, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', blocksixteen
            });
        
        GameRegistry.addRecipe(new ItemStack(Items.CHICKEN, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', blockthree
            });

        GameRegistry.addRecipe(new ItemStack(Items.FISH, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', blocktwelve
            });
        
        
        GameRegistry.addRecipe(new ItemStack(Items.COOKED_FISH, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', blockthirteen
            });
        
        GameRegistry.addRecipe(new ItemStack(blocktwelve, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', blockfourteen
            });
        
        
        GameRegistry.addRecipe(new ItemStack(blockthirteen, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', blockfifteen
            });

        GameRegistry.addRecipe(new ItemStack(blockthree, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', blockfour
            });
        
        GameRegistry.addRecipe(new ItemStack(Items.COOKED_CHICKEN, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', blockfive
            });
        
        GameRegistry.addRecipe(new ItemStack(blockfive, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', blocksix
            });
        
        GameRegistry.addRecipe(new ItemStack(Items.BEEF, 5), new Object[] {
                "   ",
                " DE",
                "   ",
                'D', blockseven, 'E',Items.BEEF
            });
        
        GameRegistry.addRecipe(new ItemStack(Items.PORKCHOP, 4), new Object[] {
                "   ",
                " DE",
                "   ",
                'D', blockseven, 'E',Items.PORKCHOP
            });
        
        GameRegistry.addRecipe(new ItemStack(blockseven, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', blockeight
            });
        
        GameRegistry.addRecipe(new ItemStack(blockseven, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', blockeight
            });
        
        GameRegistry.addRecipe(new ItemStack(Items.COOKED_BEEF, 5), new Object[] {
                "   ",
                " DE",
                "   ",
                'D', blockseven, 'E',Items.COOKED_BEEF
            });
        
        GameRegistry.addRecipe(new ItemStack(Items.COOKED_PORKCHOP, 4), new Object[] {
                "   ",
                " DE",
                "   ",
                'D', blockseven, 'E',Items.COOKED_PORKCHOP
            });
        
        GameRegistry.addRecipe(new ItemStack(armorhelmettwo, 1), new Object[] {
                "DDD",
                "D D",
                "   ",
                'D', itemfour
            });
        
        GameRegistry.addRecipe(new ItemStack(armorchestplatetwo, 1), new Object[] {
                "D D",
                "DDD",
                "DDD",
                'D', itemfour
            });
        
        GameRegistry.addRecipe(new ItemStack(armorleggingstwo, 1), new Object[] {
                "DDD",
                "D D",
                "D D",
                'D', itemfour
            });
        
        GameRegistry.addRecipe(new ItemStack(armorbootstwo, 1), new Object[] {
                "   ",
                "D D",
                "D D",
                'D', itemfour
            });
        
        GameRegistry.addRecipe(new ItemStack(itemfour, 1), new Object[] {
                " D ",
                "EHF",
                " G ",
                'D', Items.COOKED_BEEF, 'E', Items.COOKED_CHICKEN, 'F', Items.COOKED_PORKCHOP, 'G', Items.COOKED_FISH, 'H', Items.STICK
            });
        
        GameRegistry.addRecipe(new ItemStack(itemtwo, 1), new Object[] {
                " E ",
                " E ",
                " D ",
                'D', Items.STICK, 'E', itemone
            });
        
        GameRegistry.addRecipe(new ItemStack(itemthree, 1), new Object[] {
                " EE",
                " DE",
                " D ",
                'D', Items.STICK, 'E', itemone
            });
        
        GameRegistry.addRecipe(new ItemStack(itemfive, 1), new Object[] {
                " E ",
                " D ",
                " D ",
                'D', Items.STICK, 'E', itemone
            });
        
        GameRegistry.addRecipe(new ItemStack(itemsix, 1), new Object[] {
                " E ",
                "FDF",
                " E ",
                'D', Items.IRON_INGOT, 'E', Items.STICK, 'F', itemone
            });
        
        GameRegistry.addRecipe(new ItemStack(itemseven, 1), new Object[] {
                " E ",
                "DED",
                " D ",
                'D', Items.STICK, 'E', itemone
            });
        
        GameRegistry.addRecipe(new ItemStack(itemeight, 1), new Object[] {
                " EE",
                " D ",
                " D ",
                'D', Items.STICK, 'E', itemone
            });
        
        GameRegistry.addRecipe(new ItemStack(itemnine, 1), new Object[] {
                "EEE",
                " D ",
                " D ",
                'D', Items.STICK, 'E', itemone
            });
        
        GameRegistry.addRecipe(new ItemStack(itemnine, 1), new Object[] {
                "EEE",
                " D ",
                " D ",
                'D', Items.STICK, 'E', itemone
            });
        
        GameRegistry.addRecipe(new ItemStack(itemten, 1), new Object[] {
                " E ",
                "EEE",
                " E ",
                'E', Items.BEEF
            });
        
        GameRegistry.addRecipe(new ItemStack(Items.BEEF, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', itemten
            });
        
        GameRegistry.addRecipe(new ItemStack(itemeleven, 1), new Object[] {
                " E ",
                "EEE",
                " E ",
                'E', Items.COOKED_BEEF
            });
        
        GameRegistry.addRecipe(new ItemStack(Items.COOKED_BEEF, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', itemeleven
            });
        
        GameRegistry.addRecipe(new ItemStack(itemtwelve, 1), new Object[] {
                " E ",
                "EEE",
                " E ",
                'E', Items.CHICKEN
            });
        
        GameRegistry.addRecipe(new ItemStack(Items.CHICKEN, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', itemtwelve
            });
        
        GameRegistry.addRecipe(new ItemStack(itemthirteen, 1), new Object[] {
                " E ",
                "EEE",
                " E ",
                'E', Items.COOKED_CHICKEN
            });
        
        GameRegistry.addRecipe(new ItemStack(Items.COOKED_CHICKEN, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', itemthirteen
            });
        
        GameRegistry.addRecipe(new ItemStack(itemfourteen, 1), new Object[] {
                " E ",
                "EEE",
                " E ",
                'E', Items.PORKCHOP
            });
        
        GameRegistry.addRecipe(new ItemStack(Items.PORKCHOP, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', itemfourteen
            });
        
        GameRegistry.addRecipe(new ItemStack(itemfifteen, 1), new Object[] {
                " E ",
                "EEE",
                " E ",
                'E', Items.COOKED_PORKCHOP
            });
        
        GameRegistry.addRecipe(new ItemStack(Items.COOKED_PORKCHOP, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', itemfifteen
            });
        
        GameRegistry.addRecipe(new ItemStack(itemsixteen, 1), new Object[] {
                " F ",
                " E ",
                " D ",
                'D', Items.GLASS_BOTTLE, 'E', Items.WATER_BUCKET, 'F', itemone
            });
        
        GameRegistry.addRecipe(new ItemStack(itemeightteen, 1), new Object[] {
                " E ",
                "EEE",
                " E ",
                'E', itemfour
            });
        
        
        
        
        GameRegistry.addSmelting(blockone, new ItemStack(itemone, 1), 0.1f);
        GameRegistry.addSmelting(blockthree, new ItemStack(blockfive, 1), 0.1f);
        GameRegistry.addSmelting(blockfour, new ItemStack(blocksix, 1), 0.1f);
        GameRegistry.addSmelting(blockseven, new ItemStack(blocknine, 1), 0.1f);
        GameRegistry.addSmelting(blockeight, new ItemStack(blockten, 1), 0.1f);
        GameRegistry.addSmelting(armorhelmettwo, new ItemStack(armorhelmetone, 1), 0.1f);
        GameRegistry.addSmelting(armorchestplatetwo, new ItemStack(armorchestplateone, 1), 0.1f);
        GameRegistry.addSmelting(armorleggingstwo, new ItemStack(armorleggingsone, 1), 0.1f);
        GameRegistry.addSmelting(armorbootstwo, new ItemStack(armorbootsone, 1), 0.1f);
        GameRegistry.addSmelting(blocktwelve, new ItemStack(blockthirteen, 1), 0.1f);
        GameRegistry.addSmelting(blockfourteen, new ItemStack(blockfifteen, 1), 0.1f);
        GameRegistry.addSmelting(itemten, new ItemStack(itemeleven, 1), 0.1f);
        GameRegistry.addSmelting(itemtwelve, new ItemStack(itemthirteen, 1), 0.1f);
        GameRegistry.addSmelting(itemfourteen, new ItemStack(itemfifteen, 1), 0.1f);
    }

    public static void addBlocksAndItems() {
        
        blockone = new BlockOne("blockone");
        blocktwo = new BlockTwo("blocktwo");
        blockthree = new BlockThree("blockthree");
        blockfour = new BlockFour("blockfour");
        blockfive = new BlockFive("blockfive");
        blocksix = new BlockSix("blocksix");
        blockseven = new BlockSeven("blockseven");
        blockeight = new BlockEight("blockeight");
        blocknine = new BlockNine("blocknine");
        blockten = new BlockTen("blockten");
        blockeleven = new BlockEleven("blockeleven");
        blocktwelve = new BlockTwelve("blocktwelve");
        blockthirteen = new BlockThirteen("blockthirteen");
        blockfourteen = new BlockFourteen("blockfourteen");
        blockfifteen = new BlockFifteen("blockfifteen");
        blocksixteen = new BlockSixteen("blocksixteen");
        blockeightteen = new BlockEightteen("blockeightteen");
        blockpilot = new BlockPilot("blockpilot");
        blocktnt = new BlockTnt("blocktnt");
        genone = new WorldGen(blockone, 30, 24, 64);
        itemone = new ItemOne("itemone");
        itemtwo = new ItemTwo("itemtwo", ToolMaterial.STONE);
        itemthree = new ItemThree("itemthree", ToolMaterial.STONE);
        itemfour = new ItemFour("itemfour", 20, true);
        itemfive = new ItemFive("itemfive", ToolMaterial.STONE);
        itemsix = new ItemSix("itemsix", ToolMaterial.WOOD);
        itemseven = new ItemSeven("itemseven", ToolMaterial.IRON);
        itemeight = new ItemEight("itemeight", ToolMaterial.STONE);
        itemnine = new ItemNine("itemnine", ToolMaterial.STONE);
        itemten = new ItemTen("itemten", 5, false);
        itemeleven = new ItemEleven("itemeleven", 10, false);
        itemtwelve = new ItemTwelve("itemtwelve", 5, false);
        itemthirteen = new ItemThirteen("itemthirteen", 10, false);
        itemfourteen = new ItemFourteen("itemfourteen", 5, false);
        itemfifteen = new ItemFifteen("itemfifteen", 10, false);
        itemsixteen = new ItemSixteen("itemsixteen", 0, false);
        itemeightteen = new ItemEightteen("itemeightteen", 20, true);
        armorhelmetone = new ArmorItem("armorhelmetone", ARMORONE, 1, EntityEquipmentSlot.HEAD);
        armorchestplateone = new ArmorItem("armorchestplateone", ARMORONE, 2, EntityEquipmentSlot.CHEST);
        armorleggingsone = new ArmorItem("armorleggingsone", ARMORONE, 3, EntityEquipmentSlot.LEGS);
        armorbootsone = new ArmorItem("armorbootsone", ARMORONE, 4, EntityEquipmentSlot.FEET);
        armorhelmettwo = new ArmorItem("armorhelmettwo", ARMORTWO, 1, EntityEquipmentSlot.HEAD);
        armorchestplatetwo = new ArmorItem("armorchestplatetwo", ARMORTWO, 2, EntityEquipmentSlot.CHEST);
        armorleggingstwo = new ArmorItem("armorleggingstwo", ARMORTWO, 3, EntityEquipmentSlot.LEGS);
        armorbootstwo = new ArmorItem("armorbootstwo", ARMORTWO, 4, EntityEquipmentSlot.FEET);
        
    
    }

    public static void addRegisters() {

        reg(blockone);
        reg(blocktwo);
        reg(blockthree);
        reg(blockfour);
        reg(blockfive);
        reg(blocksix);
        reg(blockseven);
        reg(blockeight);
        reg(blocknine);
        reg(blockten);
        reg(blockeleven);
        reg(blocktwelve);
        reg(blockthirteen);
        reg(blockfourteen);
        reg(blockfifteen);
        reg(blocksixteen);
        reg(blockeightteen);
        reg(blockpilot);
        reg(blocktnt);
        reg(itemone);
        reg(itemtwo);
        reg(itemthree);
        reg(itemfour);
        reg(itemfive);
        reg(itemsix);
        reg(itemseven);
        reg(itemeight);
        reg(itemnine);
        reg(itemten);
        reg(itemeleven);
        reg(itemtwelve);
        reg(itemthirteen);
        reg(itemfourteen);
        reg(itemfifteen);
        reg(itemsixteen);
        reg(itemeightteen);
        reg(armorhelmetone);
        reg(armorchestplateone);
        reg(armorleggingsone);
        reg(armorbootsone);
        reg(armorhelmettwo);
        reg(armorchestplatetwo);
        reg(armorleggingstwo);
        reg(armorbootstwo);


        
    }

    public static void reg(Block block) {
        Item item = Item.getItemFromBlock(block);
        reg(item);
    }

    public static void reg(Item item) {
            ModelResourceLocation model = new ModelResourceLocation(item.getRegistryName(), "inventory");
            ModelLoader.registerItemVariants(item, model);
            Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, model);
    }

}

If you need anything else I will supply

Posted

Where do you register the block itself?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
7 minutes ago, Draco18s said:

Where do you register the block itself?

Also here is the log

Spoiler

Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

[16:42:31] [main/INFO] [GradleStart]: Extra: []

[16:42:32] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, /Users/cylinross/.gradle/caches/minecraft/assets, --assetIndex, 1.11, --accessToken{REDACTED}, --version, 1.11.2, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]

[16:42:32] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker

[16:42:32] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker

[16:42:32] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker

[16:42:32] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker

[16:42:32] [main/INFO] [FML]: Forge Mod Loader version 13.20.0.2345 for Minecraft 1.11.2 loading

[16:42:32] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_131, running on Mac OS X:x86_64:10.12.5, installed at /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre

[16:42:32] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation

[16:42:32] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker

[16:42:32] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin

[16:42:32] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin

[16:42:32] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[16:42:32] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker

[16:42:32] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker

[16:42:32] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[16:42:32] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[16:42:32] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper

[16:42:32] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!

[16:42:34] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing

[16:42:34] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper

[16:42:34] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker

[16:42:35] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker

[16:42:35] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker

[16:42:35] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker

[16:42:35] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}

[16:42:37] [Client thread/INFO]: Setting user: Player582

[16:42:41] [Client thread/WARN]: Skipping bad option: lastServer:

[16:42:41] [Client thread/INFO]: LWJGL Version: 2.9.2

[16:42:42] [Client thread/INFO] [FML]: MinecraftForge v13.20.0.2345 Initialized

[16:42:42] [Client thread/INFO] [FML]: Replaced 232 ore recipes

[16:42:42] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer

[16:42:42] [Client thread/INFO] [FML]: Searching /Users/cylinross/Desktop/Mods/mod/run/mods for mods

[16:42:44] [Client thread/INFO] [FML]: Forge Mod Loader has identified 5 mods to load

[16:42:45] [Client thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, mainmod] at CLIENT

[16:42:45] [Client thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, mainmod] at SERVER

[16:42:45] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:The Meat Mod

[16:42:46] [Client thread/INFO] [FML]: Processing ObjectHolder annotations

[16:42:46] [Client thread/INFO] [FML]: Found 445 ObjectHolder annotations

[16:42:46] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations

[16:42:46] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations

[16:42:46] [Client thread/INFO] [FML]: Applying holder lookups

[16:42:46] [Client thread/INFO] [FML]: Holder lookups applied

[16:42:46] [Client thread/INFO] [FML]: Applying holder lookups

[16:42:46] [Client thread/INFO] [FML]: Holder lookups applied

[16:42:46] [Client thread/INFO] [FML]: Applying holder lookups

[16:42:46] [Client thread/INFO] [FML]: Holder lookups applied

[16:42:46] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0

[16:42:46] [Forge Version Check/INFO] [ForgeVersionCheck]: [forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json

[16:42:46] [Client thread/INFO] [FML]: Applying holder lookups

[16:42:46] [Client thread/INFO] [FML]: Holder lookups applied

[16:42:46] [Client thread/INFO] [FML]: Injecting itemstacks

[16:42:46] [Client thread/INFO] [FML]: Itemstack injection complete

[16:42:46] [Forge Version Check/INFO] [ForgeVersionCheck]: [forge] Found status: OUTDATED Target: 13.20.1.2386

[16:42:47] [Sound Library Loader/INFO]: Starting up SoundSystem...

[16:42:47] [Thread-6/INFO]: Initializing LWJGL OpenAL

[16:42:47] [Thread-6/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

[16:42:48] [Thread-6/INFO]: OpenAL initialized.

[16:42:48] [Sound Library Loader/INFO]: Sound engine started

[16:42:49] [Client thread/INFO] [FML]: Max texture size: 16384

[16:42:49] [Client thread/INFO]: Created: 16x16 textures-atlas

[16:42:49] [Client thread/INFO] [FML]: Injecting itemstacks

[16:42:49] [Client thread/INFO] [FML]: Itemstack injection complete

[16:42:49] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 5 mods

[16:42:49] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:The Meat Mod

[16:42:50] [Client thread/INFO]: SoundSystem shutting down...

[16:42:50] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com

[16:42:50] [Sound Library Loader/INFO]: Starting up SoundSystem...

[16:42:51] [Thread-8/INFO]: Initializing LWJGL OpenAL

[16:42:51] [Thread-8/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

[16:42:51] [Thread-8/INFO]: OpenAL initialized.

[16:42:51] [Sound Library Loader/INFO]: Sound engine started

[16:42:52] [Client thread/INFO] [FML]: Max texture size: 16384

[16:42:52] [Client thread/WARN]: Texture mainmod:textures/blocks/blockpilot.png with size 465x465 will have visual artifacts at mip level 4, it can only support level 0. Please report to the mod author that the texture should be some multiple of 16x16.

[16:42:52] [Client thread/WARN]: Texture mainmod:textures/items/itemseven.png with size 150x150 will have visual artifacts at mip level 4, it can only support level 1. Please report to the mod author that the texture should be some multiple of 16x16.

[16:42:52] [Client thread/INFO]: Created: 1024x512 textures-atlas

[16:42:53] [Client thread/WARN]: Skipping bad option: lastServer:

[16:42:56] [Realms Notification Availability checker #1/INFO]: Could not authorize you against Realms server: Invalid session id

[16:43:00] [Server thread/INFO]: Starting integrated minecraft server version 1.11.2

[16:43:00] [Server thread/INFO]: Generating keypair

[16:43:00] [Server thread/INFO] [FML]: Injecting existing block and item data into this server instance

[16:43:00] [Server thread/INFO] [FML]: Applying holder lookups

[16:43:00] [Server thread/INFO] [FML]: Holder lookups applied

[16:43:00] [Server thread/INFO] [FML]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@32cd0d58)

[16:43:01] [Server thread/INFO] [FML]: Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@32cd0d58)

[16:43:01] [Server thread/INFO] [FML]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@32cd0d58)

[16:43:01] [Server thread/INFO]: Preparing start region for level 0

[16:43:02] [Server thread/INFO]: Preparing spawn area: 9%

[16:43:03] [Server thread/INFO]: Preparing spawn area: 19%

[16:43:04] [Server thread/INFO]: Preparing spawn area: 30%

[16:43:05] [Server thread/INFO]: Preparing spawn area: 42%

[16:43:06] [Server thread/INFO]: Preparing spawn area: 55%

[16:43:07] [Server thread/INFO]: Preparing spawn area: 68%

[16:43:08] [Server thread/INFO]: Preparing spawn area: 85%

[16:43:09] [Server thread/INFO]: Changing view distance to 12, from 10

[16:43:10] [Netty Local Client IO #0/INFO] [FML]: Server protocol version 2

[16:43:10] [Netty Server IO #1/INFO] [FML]: Client protocol version 2

[16:43:10] [Netty Server IO #1/INFO] [FML]: Client attempting to join with 5 mods : [email protected],[email protected],[email protected],[email protected],[email protected]

[16:43:10] [Netty Local Client IO #0/INFO] [FML]: [Netty Local Client IO #0] Client side modded connection established

[16:43:10] [Server thread/INFO] [FML]: [Server thread] Server side modded connection established

[16:43:10] [Server thread/INFO]: Player582[local:E:ddb1326f] logged in with entity id 669 at (25.5, 69.0, 254.5)

[16:43:10] [Server thread/INFO]: Player582 joined the game

[16:43:11] [pool-2-thread-1/WARN]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@50837281[id=5d36a45e-9473-37e3-8760-623ba7be7a5c,name=Player582,properties={},legacy=false]

com.mojang.authlib.exceptions.AuthenticationException: The client has sent too many requests within a certain amount of time

at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:79) ~[YggdrasilAuthenticationService.class:?]

at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillGameProfile(YggdrasilMinecraftSessionService.java:180) [YggdrasilMinecraftSessionService.class:?]

at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:60) [YggdrasilMinecraftSessionService$1.class:?]

at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:57) [YggdrasilMinecraftSessionService$1.class:?]

at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524) [guava-17.0.jar:?]

at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317) [guava-17.0.jar:?]

at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280) [guava-17.0.jar:?]

at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195) [guava-17.0.jar:?]

at com.google.common.cache.LocalCache.get(LocalCache.java:3934) [guava-17.0.jar:?]

at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938) [guava-17.0.jar:?]

at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821) [guava-17.0.jar:?]

at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4827) [guava-17.0.jar:?]

at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:170) [YggdrasilMinecraftSessionService.class:?]

at net.minecraft.client.Minecraft.getProfileProperties(Minecraft.java:3056) [Minecraft.class:?]

at net.minecraft.client.resources.SkinManager$3.run(SkinManager.java:138) [SkinManager$3.class:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_131]

at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_131]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_131]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_131]

at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]

[16:43:12] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 2963ms behind, skipping 59 tick(s)

[16:43:13] [Server thread/INFO]: Player582 has just earned the achievement [Taking Inventory]

[16:43:13] [Client thread/INFO]: [CHAT] Player582 has just earned the achievement [Taking Inventory]

 

Posted
10 minutes ago, BlockExpert said:

Inside the register (I do things differently then most).

1

No, you don't. If you do, please show us the exact line where you call GameRegistry.registerBlock.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted (edited)
4 minutes ago, larsgerrits said:

No, you don't. If you do, please show us the exact line where you call GameRegistry.registerBlock.

First of all, if I was doing it wrong then how are all my other blocks in the game.

Second, here. They are in bold and sized up.

Spoiler

package com.planetbravo.mainmod;

import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.registry.GameRegistry;

public final class Register {

    public static String modid = Main.MODID;

    public static Block blockone;
    public static Block blocktwo;
    public static Block blockthree;
    public static Block blockfour;
    public static Block blockfive;
    public static Block blocksix;
    public static Block blockseven;
    public static Block blockeight;
    public static Block blocknine;
    public static Block blockten;
    public static Block blockeleven;
    public static Block blocktwelve;
    public static Block blockthirteen;
    public static Block blockfourteen;
    public static Block blockfifteen;
    public static Block blocksixteen;
    public static Block blockeightteen;
    public static Block blockpilot;
    public static Block blocktnt;
    public static WorldGen genone;
    public static Item itemone;
    public static Item itemtwo;
    public static Item itemthree;
    public static Item itemfour;
    public static Item itemfive;
    public static Item itemsix;
    public static Item itemseven;
    public static Item itemeight;
    public static Item itemnine;
    public static Item itemten;
    public static Item itemeleven;
    public static Item itemtwelve;
    public static Item itemthirteen;
    public static Item itemfourteen;
    public static Item itemfifteen;
    public static Item itemsixteen;
    public static Item itemeightteen;
    public static ArmorMaterial ARMORONE = EnumHelper.addArmorMaterial("armorone", "mainmod:armorone", 16, new int[] {3, 5, 4, 3}, 30, null, 0);
    public static Item armorhelmetone;
    public static Item armorchestplateone;
    public static Item armorleggingsone;
    public static Item armorbootsone;
    public static ArmorMaterial ARMORTWO = EnumHelper.addArmorMaterial("armortwo", "mainmod:armortwo", 16, new int[] {2, 4, 3, 2}, 30, null, 0);
    public static Item armorhelmettwo;
    public static Item armorchestplatetwo;
    public static Item armorleggingstwo;
    public static Item armorbootstwo;
    public static CreativeTabs mainTab = new MainTab("meatModMenu");

    public static void addRecipes() {
        GameRegistry.addRecipe(new ItemStack(blocktwo, 1), new Object[] {
                "DDD",
                "DDD",
                "DDD",
                'D', itemone
            });
        
        GameRegistry.addRecipe(new ItemStack(blockthree, 1), new Object[] {
                "DDD",
                "DDD",
                "DDD",
                'D', Items.CHICKEN
            });
        
        GameRegistry.addRecipe(new ItemStack(blockfour, 1), new Object[] {
                "DDD",
                "DDD",
                "DDD",
                'D', blockthree
            });
        
        GameRegistry.addRecipe(new ItemStack(blockfive, 1), new Object[] {
                "DDD",
                "DDD",
                "DDD",
                'D', Items.COOKED_CHICKEN
            });
        
        GameRegistry.addRecipe(new ItemStack(blocksix, 1), new Object[] {
                "DDD",
                "DDD",
                "DDD",
                'D', blockfive
            });
        
        GameRegistry.addRecipe(new ItemStack(blockseven, 1), new Object[] {
                "EDE",
                "DED",
                "EDE",
                'D', Items.PORKCHOP, 'E', Items.BEEF
            });
        
        GameRegistry.addRecipe(new ItemStack(blockeight, 1), new Object[] {
                "DDD",
                "DDD",
                "DDD",
                'D', blockseven
            });
        
        GameRegistry.addRecipe(new ItemStack(blocknine, 1), new Object[] {
                "EDE",
                "DED",
                "EDE",
                'D', Items.COOKED_PORKCHOP, 'E', Items.COOKED_BEEF
            });
        
        GameRegistry.addRecipe(new ItemStack(blockten, 1), new Object[] {
                "DDD",
                "DDD",
                "DDD",
                'D', blocknine
            });
        
        GameRegistry.addRecipe(new ItemStack(blocktwelve, 1), new Object[] {
                "DDD",
                "DDD",
                "DDD",
                'D', Items.FISH
            });
        
        GameRegistry.addRecipe(new ItemStack(blockfourteen, 1), new Object[] {
                "DDD",
                "DDD",
                "DDD",
                'D', blocktwelve
            });
        
        GameRegistry.addRecipe(new ItemStack(blockthirteen, 1), new Object[] {
                "DDD",
                "DDD",
                "DDD",
                'D', Items.COOKED_FISH
            });
        
        GameRegistry.addRecipe(new ItemStack(blockfifteen, 1), new Object[] {
                "DDD",
                "DDD",
                "DDD",
                'D', blockthirteen
            });
        
        GameRegistry.addRecipe(new ItemStack(blocksixteen, 1), new Object[] {
                "DDD",
                "DDD",
                "DDD",
                'D', itemfour
            });
        
        GameRegistry.addRecipe(new ItemStack(blockeightteen, 1), new Object[] {
                "DDD",
                "DDD",
                "DDD",
                'D', blocksixteen
            });
        
        GameRegistry.addRecipe(new ItemStack(blocksixteen, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', blockeightteen
            });
        
        GameRegistry.addRecipe(new ItemStack(itemfour, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', blocksixteen
            });
        
        GameRegistry.addRecipe(new ItemStack(Items.CHICKEN, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', blockthree
            });

        GameRegistry.addRecipe(new ItemStack(Items.FISH, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', blocktwelve
            });
        
        
        GameRegistry.addRecipe(new ItemStack(Items.COOKED_FISH, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', blockthirteen
            });
        
        GameRegistry.addRecipe(new ItemStack(blocktwelve, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', blockfourteen
            });
        
        
        GameRegistry.addRecipe(new ItemStack(blockthirteen, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', blockfifteen
            });

        GameRegistry.addRecipe(new ItemStack(blockthree, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', blockfour
            });
        
        GameRegistry.addRecipe(new ItemStack(Items.COOKED_CHICKEN, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', blockfive
            });
        
        GameRegistry.addRecipe(new ItemStack(blockfive, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', blocksix
            });
        
        GameRegistry.addRecipe(new ItemStack(Items.BEEF, 5), new Object[] {
                "   ",
                " DE",
                "   ",
                'D', blockseven, 'E',Items.BEEF
            });
        
        GameRegistry.addRecipe(new ItemStack(Items.PORKCHOP, 4), new Object[] {
                "   ",
                " DE",
                "   ",
                'D', blockseven, 'E',Items.PORKCHOP
            });
        
        GameRegistry.addRecipe(new ItemStack(blockseven, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', blockeight
            });
        
        GameRegistry.addRecipe(new ItemStack(blockseven, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', blockeight
            });
        
        GameRegistry.addRecipe(new ItemStack(Items.COOKED_BEEF, 5), new Object[] {
                "   ",
                " DE",
                "   ",
                'D', blockseven, 'E',Items.COOKED_BEEF
            });
        
        GameRegistry.addRecipe(new ItemStack(Items.COOKED_PORKCHOP, 4), new Object[] {
                "   ",
                " DE",
                "   ",
                'D', blockseven, 'E',Items.COOKED_PORKCHOP
            });
        
        GameRegistry.addRecipe(new ItemStack(armorhelmettwo, 1), new Object[] {
                "DDD",
                "D D",
                "   ",
                'D', itemfour
            });
        
        GameRegistry.addRecipe(new ItemStack(armorchestplatetwo, 1), new Object[] {
                "D D",
                "DDD",
                "DDD",
                'D', itemfour
            });
        
        GameRegistry.addRecipe(new ItemStack(armorleggingstwo, 1), new Object[] {
                "DDD",
                "D D",
                "D D",
                'D', itemfour
            });
        
        GameRegistry.addRecipe(new ItemStack(armorbootstwo, 1), new Object[] {
                "   ",
                "D D",
                "D D",
                'D', itemfour
            });
        
        GameRegistry.addRecipe(new ItemStack(itemfour, 1), new Object[] {
                " D ",
                "EHF",
                " G ",
                'D', Items.COOKED_BEEF, 'E', Items.COOKED_CHICKEN, 'F', Items.COOKED_PORKCHOP, 'G', Items.COOKED_FISH, 'H', Items.STICK
            });
        
        GameRegistry.addRecipe(new ItemStack(itemtwo, 1), new Object[] {
                " E ",
                " E ",
                " D ",
                'D', Items.STICK, 'E', itemone
            });
        
        GameRegistry.addRecipe(new ItemStack(itemthree, 1), new Object[] {
                " EE",
                " DE",
                " D ",
                'D', Items.STICK, 'E', itemone
            });
        
        GameRegistry.addRecipe(new ItemStack(itemfive, 1), new Object[] {
                " E ",
                " D ",
                " D ",
                'D', Items.STICK, 'E', itemone
            });
        
        GameRegistry.addRecipe(new ItemStack(itemsix, 1), new Object[] {
                " E ",
                "FDF",
                " E ",
                'D', Items.IRON_INGOT, 'E', Items.STICK, 'F', itemone
            });
        
        GameRegistry.addRecipe(new ItemStack(itemseven, 1), new Object[] {
                " E ",
                "DED",
                " D ",
                'D', Items.STICK, 'E', itemone
            });
        
        GameRegistry.addRecipe(new ItemStack(itemeight, 1), new Object[] {
                " EE",
                " D ",
                " D ",
                'D', Items.STICK, 'E', itemone
            });
        
        GameRegistry.addRecipe(new ItemStack(itemnine, 1), new Object[] {
                "EEE",
                " D ",
                " D ",
                'D', Items.STICK, 'E', itemone
            });
        
        GameRegistry.addRecipe(new ItemStack(itemnine, 1), new Object[] {
                "EEE",
                " D ",
                " D ",
                'D', Items.STICK, 'E', itemone
            });
        
        GameRegistry.addRecipe(new ItemStack(itemten, 1), new Object[] {
                " E ",
                "EEE",
                " E ",
                'E', Items.BEEF
            });
        
        GameRegistry.addRecipe(new ItemStack(Items.BEEF, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', itemten
            });
        
        GameRegistry.addRecipe(new ItemStack(itemeleven, 1), new Object[] {
                " E ",
                "EEE",
                " E ",
                'E', Items.COOKED_BEEF
            });
        
        GameRegistry.addRecipe(new ItemStack(Items.COOKED_BEEF, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', itemeleven
            });
        
        GameRegistry.addRecipe(new ItemStack(itemtwelve, 1), new Object[] {
                " E ",
                "EEE",
                " E ",
                'E', Items.CHICKEN
            });
        
        GameRegistry.addRecipe(new ItemStack(Items.CHICKEN, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', itemtwelve
            });
        
        GameRegistry.addRecipe(new ItemStack(itemthirteen, 1), new Object[] {
                " E ",
                "EEE",
                " E ",
                'E', Items.COOKED_CHICKEN
            });
        
        GameRegistry.addRecipe(new ItemStack(Items.COOKED_CHICKEN, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', itemthirteen
            });
        
        GameRegistry.addRecipe(new ItemStack(itemfourteen, 1), new Object[] {
                " E ",
                "EEE",
                " E ",
                'E', Items.PORKCHOP
            });
        
        GameRegistry.addRecipe(new ItemStack(Items.PORKCHOP, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', itemfourteen
            });
        
        GameRegistry.addRecipe(new ItemStack(itemfifteen, 1), new Object[] {
                " E ",
                "EEE",
                " E ",
                'E', Items.COOKED_PORKCHOP
            });
        
        GameRegistry.addRecipe(new ItemStack(Items.COOKED_PORKCHOP, 9), new Object[] {
                "   ",
                " D ",
                "   ",
                'D', itemfifteen
            });
        
        GameRegistry.addRecipe(new ItemStack(itemsixteen, 1), new Object[] {
                " F ",
                " E ",
                " D ",
                'D', Items.GLASS_BOTTLE, 'E', Items.WATER_BUCKET, 'F', itemone
            });
        
        GameRegistry.addRecipe(new ItemStack(itemeightteen, 1), new Object[] {
                " E ",
                "EEE",
                " E ",
                'E', itemfour
            });
        
        
        
        
        GameRegistry.addSmelting(blockone, new ItemStack(itemone, 1), 0.1f);
        GameRegistry.addSmelting(blockthree, new ItemStack(blockfive, 1), 0.1f);
        GameRegistry.addSmelting(blockfour, new ItemStack(blocksix, 1), 0.1f);
        GameRegistry.addSmelting(blockseven, new ItemStack(blocknine, 1), 0.1f);
        GameRegistry.addSmelting(blockeight, new ItemStack(blockten, 1), 0.1f);
        GameRegistry.addSmelting(armorhelmettwo, new ItemStack(armorhelmetone, 1), 0.1f);
        GameRegistry.addSmelting(armorchestplatetwo, new ItemStack(armorchestplateone, 1), 0.1f);
        GameRegistry.addSmelting(armorleggingstwo, new ItemStack(armorleggingsone, 1), 0.1f);
        GameRegistry.addSmelting(armorbootstwo, new ItemStack(armorbootsone, 1), 0.1f);
        GameRegistry.addSmelting(blocktwelve, new ItemStack(blockthirteen, 1), 0.1f);
        GameRegistry.addSmelting(blockfourteen, new ItemStack(blockfifteen, 1), 0.1f);
        GameRegistry.addSmelting(itemten, new ItemStack(itemeleven, 1), 0.1f);
        GameRegistry.addSmelting(itemtwelve, new ItemStack(itemthirteen, 1), 0.1f);
        GameRegistry.addSmelting(itemfourteen, new ItemStack(itemfifteen, 1), 0.1f);
    }

    public static void addBlocksAndItems() {
        
        blockone = new BlockOne("blockone");
        blocktwo = new BlockTwo("blocktwo");
        blockthree = new BlockThree("blockthree");
        blockfour = new BlockFour("blockfour");
        blockfive = new BlockFive("blockfive");
        blocksix = new BlockSix("blocksix");
        blockseven = new BlockSeven("blockseven");
        blockeight = new BlockEight("blockeight");
        blocknine = new BlockNine("blocknine");
        blockten = new BlockTen("blockten");
        blockeleven = new BlockEleven("blockeleven");
        blocktwelve = new BlockTwelve("blocktwelve");
        blockthirteen = new BlockThirteen("blockthirteen");
        blockfourteen = new BlockFourteen("blockfourteen");
        blockfifteen = new BlockFifteen("blockfifteen");
        blocksixteen = new BlockSixteen("blocksixteen");
        blockeightteen = new BlockEightteen("blockeightteen");
        blockpilot = new BlockPilot("blockpilot");
        blocktnt = new BlockTnt("blocktnt");
        genone = new WorldGen(blockone, 30, 24, 64);
        itemone = new ItemOne("itemone");
        itemtwo = new ItemTwo("itemtwo", ToolMaterial.STONE);
        itemthree = new ItemThree("itemthree", ToolMaterial.STONE);
        itemfour = new ItemFour("itemfour", 20, true);
        itemfive = new ItemFive("itemfive", ToolMaterial.STONE);
        itemsix = new ItemSix("itemsix", ToolMaterial.WOOD);
        itemseven = new ItemSeven("itemseven", ToolMaterial.IRON);
        itemeight = new ItemEight("itemeight", ToolMaterial.STONE);
        itemnine = new ItemNine("itemnine", ToolMaterial.STONE);
        itemten = new ItemTen("itemten", 5, false);
        itemeleven = new ItemEleven("itemeleven", 10, false);
        itemtwelve = new ItemTwelve("itemtwelve", 5, false);
        itemthirteen = new ItemThirteen("itemthirteen", 10, false);
        itemfourteen = new ItemFourteen("itemfourteen", 5, false);
        itemfifteen = new ItemFifteen("itemfifteen", 10, false);
        itemsixteen = new ItemSixteen("itemsixteen", 0, false);
        itemeightteen = new ItemEightteen("itemeightteen", 20, true);
        armorhelmetone = new ArmorItem("armorhelmetone", ARMORONE, 1, EntityEquipmentSlot.HEAD);
        armorchestplateone = new ArmorItem("armorchestplateone", ARMORONE, 2, EntityEquipmentSlot.CHEST);
        armorleggingsone = new ArmorItem("armorleggingsone", ARMORONE, 3, EntityEquipmentSlot.LEGS);
        armorbootsone = new ArmorItem("armorbootsone", ARMORONE, 4, EntityEquipmentSlot.FEET);
        armorhelmettwo = new ArmorItem("armorhelmettwo", ARMORTWO, 1, EntityEquipmentSlot.HEAD);
        armorchestplatetwo = new ArmorItem("armorchestplatetwo", ARMORTWO, 2, EntityEquipmentSlot.CHEST);
        armorleggingstwo = new ArmorItem("armorleggingstwo", ARMORTWO, 3, EntityEquipmentSlot.LEGS);
        armorbootstwo = new ArmorItem("armorbootstwo", ARMORTWO, 4, EntityEquipmentSlot.FEET);
        
    
    }

    public static void addRegisters() {

        reg(blockone);
        reg(blocktwo);
        reg(blockthree);
        reg(blockfour);
        reg(blockfive);
        reg(blocksix);
        reg(blockseven);
        reg(blockeight);
        reg(blocknine);
        reg(blockten);
        reg(blockeleven);
        reg(blocktwelve);
        reg(blockthirteen);
        reg(blockfourteen);
        reg(blockfifteen);
        reg(blocksixteen);
        reg(blockeightteen);
        reg(blockpilot);
        reg(blocktnt);
        reg(itemone);
        reg(itemtwo);
        reg(itemthree);
        reg(itemfour);
        reg(itemfive);
        reg(itemsix);
        reg(itemseven);
        reg(itemeight);
        reg(itemnine);
        reg(itemten);
        reg(itemeleven);
        reg(itemtwelve);
        reg(itemthirteen);
        reg(itemfourteen);
        reg(itemfifteen);
        reg(itemsixteen);
        reg(itemeightteen);
        reg(armorhelmetone);
        reg(armorchestplateone);
        reg(armorleggingsone);
        reg(armorbootsone);
        reg(armorhelmettwo);
        reg(armorchestplatetwo);
        reg(armorleggingstwo);
        reg(armorbootstwo);


        
    }

    public static void reg(Block block) {
        Item item = Item.getItemFromBlock(block);
        reg(item);
    }

    public static void reg(Item item) {
            ModelResourceLocation model = new ModelResourceLocation(item.getRegistryName(), "inventory");
            ModelLoader.registerItemVariants(item, model);
            Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, model);
    }

}

 

Edited by BlockExpert
Posted
6 minutes ago, BlockExpert said:

    public static void reg(Block block) {
        Item item = Item.getItemFromBlock(block);
        reg(item);
    }

This method does not register a block. It creates an itemblock and then calls another method which registers a model for the itemblock, without registering it either.

Posted
Just now, Jay Avery said:

This method does not register a block. It creates an itemblock and then calls another method which registers a model for the itemblock, without registering it either.

Thanks but look at my last post also I got the block to appear in game but it's textureless and has the default tnt when exploding

Posted
11 minutes ago, BlockExpert said:

then how are all my other blocks in the game.

Maybe you are registering them in a different place, but not for your TNT block.

 

28 minutes ago, BlockExpert said:

I do things differently then most

Yes, but that is not always better.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted (edited)
4 minutes ago, BlockExpert said:

Thanks but look at my last post also I got the block to appear in game but it's textureless and has the default tnt when exploding

Registering blocks and items is crucially important to a functional mod. Regardless of whether it seems to be working, failing to register things is a fatal problem which you should prioritise over anything else.

 

If you block's model or textures are not working properly, post the blockstates file and model file(s).

Edited by Jay Avery
Posted
Just now, Jay Avery said:

Registering blocks and items is crucially important to a functional mod. Regardless of whether it seems to be working, failing to register things is a fatal problem which you should prioritise over anything else.

 

If you block's model or textures are not working properly, post the blockstates file and model file(s).

I just thought that the blockstate for tnt might be different than normal blocks. I'm going to research and test and if it fails I'll come back.

Posted
4 minutes ago, larsgerrits said:

Maybe you are registering them in a different place, but not for your TNT block.

Just checked they are all registering in the same place.

 

5 minutes ago, larsgerrits said:

Yes, but that is not always better.

True but it's more effective for me

Posted

Have you considered using an array for "blockone" through " blockeightteen"? Either that or using more informative names? The numeric naming is malodorous.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.