• 0

    posted a message on NEVERMIND...

    Nevermind, I give up on the project.

    Posted in: Modification Development
  • 0

    posted a message on NEVERMIND...

    Help me! I am currently trying to make a 3d moeled fire extinguisher for
    my mod, and things are not going well. I have watched a thousand
    youtube videos and they all do it differently. One requires a "client
    proxy", another requires me to make a whole new mod, but all I want and
    need is a simple tutorial on how to make a new Item class (called
    whatever) that can work with a java Techne model, and be textured.
    Please tell me everything that I need for doing this in 1.8.X and if
    possible, how to do it or a link to an easy to follow tutorial. Thanks

    Here is my Mod file:


    package com.example.examplemod;

    //ExampleMod.java



    import com.camp.block.BlockManager;

    import com.camp.entity.CustomMan;

    import com.camp.entity.CustomMob;

    import com.camp.entity.RenderCustomBiped;

    import com.camp.gui.ItemGui;

    import com.camp.item.ItemManager;

    import com.camp.world.CustomWorldGenerator;



    import net.minecraft.client.Minecraft;

    import net.minecraft.client.renderer.entity.RenderItem;

    import net.minecraft.client.resources.model.ModelResourceLocation;

    import net.minecraft.entity.EntityList;

    import net.minecraft.entity.EnumCreatureType;

    import net.minecraft.entity.item.EntityItem;

    import net.minecraft.init.Blocks;

    import net.minecraft.init.Items;

    import net.minecraft.item.Item;

    import net.minecraft.item.Item.ToolMaterial;

    import net.minecraft.item.ItemArmor.ArmorMaterial;

    import net.minecraft.item.ItemStack;

    import net.minecraft.util.DamageSource;

    import net.minecraft.world.biome.BiomeGenBase;

    import net.minecraftforge.client.MinecraftForgeClient;

    import net.minecraftforge.common.MinecraftForge;

    import net.minecraftforge.common.util.EnumHelper;

    import net.minecraftforge.event.entity.living.LivingDropsEvent;

    import net.minecraftforge.fml.client.registry.RenderingRegistry;

    import net.minecraftforge.fml.common.Mod;

    import net.minecraftforge.fml.common.Mod.EventHandler;

    import net.minecraftforge.fml.common.Mod.Instance;

    import net.minecraftforge.fml.common.event.FMLInitializationEvent;

    import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;

    import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

    import net.minecraftforge.fml.common.registry.EntityRegistry;

    import net.minecraftforge.fml.common.registry.GameRegistry;

    import net.minecraftforge.fml.relauncher.Side;



    @Mod(modid = ExampleMod.MODID, version = ExampleMod.VERSION)

    public class ExampleMod

    {

    //@Instance (value="ExampleMod")

    //public static ExampleMod instance;



    public static final String MODID = "examplemod";

    public static final String VERSION = "1.0";

    public static ToolMaterial customToolMaterial;

    public static ArmorMaterial customArmorMaterial;

    public static CustomWorldGenerator customOreGenerator;



    @EventHandler

    public void preinit(FMLPreInitializationEvent event)

    {

    customToolMaterial = EnumHelper.addToolMaterial("Sauce", 3, 10000, 1000, 20000, 20000);

    customArmorMaterial = EnumHelper.addArmorMaterial("Hard Sauce",
    "customarmor", 20000, new int[]{20000,20000,20000,20000}, 20000);

    ItemManager.mainRegistry();

    BlockManager.mainRegistry();

    createEntity(CustomMan.class, "CustomMan", 0xFF4A1C, 0x000000);



    }

    @EventHandler

    public void init(FMLInitializationEvent event)

    {

    if(event.getSide() == Side.CLIENT)

    {

    RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();


    renderItem.getItemModelMesher().register(ItemManager.customItem, 0, new
    ModelResourceLocation(this.MODID + ":" + ItemManager.customItem.name,
    "inventory"));


    renderItem.getItemModelMesher().register(ItemManager.customItem2, 0, new
    ModelResourceLocation(this.MODID + ":" + ItemManager.customItem2.name,
    "inventory"));


    renderItem.getItemModelMesher().register(ItemManager.customPickaxe, 0,
    new ModelResourceLocation(this.MODID + ":" +
    ItemManager.customPickaxe.name, "inventory"));


    renderItem.getItemModelMesher().register(ItemManager.customSword, 0, new
    ModelResourceLocation(this.MODID + ":" + ItemManager.customSword.name,
    "inventory"));


    renderItem.getItemModelMesher().register(ItemManager.customFood, 0, new
    ModelResourceLocation(this.MODID + ":" + ItemManager.customFood.name,
    "inventory"));


    renderItem.getItemModelMesher().register(ItemManager.customHelm, 0, new
    ModelResourceLocation(this.MODID + ":" + ItemManager.customHelm.name,
    "inventory"));


    renderItem.getItemModelMesher().register(ItemManager.customChestplate,
    0, new ModelResourceLocation(this.MODID + ":" +
    ItemManager.customChestplate.name, "inventory"));


    renderItem.getItemModelMesher().register(ItemManager.customLeggings, 0,
    new ModelResourceLocation(this.MODID + ":" +
    ItemManager.customLeggings.name, "inventory"));


    renderItem.getItemModelMesher().register(ItemManager.customBoots, 0, new
    ModelResourceLocation(this.MODID + ":" + ItemManager.customBoots.name,
    "inventory"));


    renderItem.getItemModelMesher().register(ItemManager.customShovel, 0,
    new ModelResourceLocation(this.MODID + ":" +
    ItemManager.customShovel.name, "inventory"));


    renderItem.getItemModelMesher().register(ItemManager.customAxe, 0, new
    ModelResourceLocation(this.MODID + ":" + ItemManager.customAxe.name,
    "inventory"));


    renderItem.getItemModelMesher().register(ItemManager.customHoe, 0, new
    ModelResourceLocation(this.MODID + ":" + ItemManager.customHoe.name,
    "inventory"));


    renderItem.getItemModelMesher().register(Item.getItemFromBlock(BlockManager.customBlock),
    0, new ModelResourceLocation(this.MODID + ":" +
    BlockManager.customBlock.name, "inventory"));


    renderItem.getItemModelMesher().register(Item.getItemFromBlock(BlockManager.customBlock2),
    0, new ModelResourceLocation(this.MODID + ":" +
    BlockManager.customBlock2.name, "inventory"));

    RenderingRegistry.registerEntityRenderingHandler(CustomMan.class, new RenderCustomBiped(new CustomMob(), 0.5f));

    GameRegistry.addShapelessRecipe(new ItemStack(ItemManager.customItem),Items.diamond,Items.ender_pearl);

    GameRegistry.addShapelessRecipe(new ItemStack(Items.nether_star, 64), Items.slime_ball, Items.coal);

    GameRegistry.addShapedRecipe(new
    ItemStack(ItemManager.customPickaxe,1), "xxx", " y ", " y ", 'x',
    Items.nether_star, 'y', Items.stick);

    GameRegistry.addShapedRecipe(new
    ItemStack(ItemManager.customSword,1), " x ", " x ", " y ", 'x',
    Items.nether_star, 'y', Items.stick);

    GameRegistry.addShapedRecipe(new
    ItemStack(ItemManager.customAxe, 1), "xx ", "xy ", " y ", 'x',
    Items.nether_star, 'y', Items.stick);

    GameRegistry.addShapedRecipe(new
    ItemStack(ItemManager.customShovel, 1), " x ", " y ", " y ", 'x',
    Items.nether_star, 'y', Items.stick);

    GameRegistry.addShapedRecipe(new
    ItemStack(ItemManager.customHoe, 1), "xx ", " y ", " y ", 'x',
    Items.nether_star, 'y', Items.stick);

    GameRegistry.addShapedRecipe(new ItemStack(ItemManager.customHelm,1), " ", "xxx", "x x", 'x', Items.nether_star);

    GameRegistry.addShapedRecipe(new ItemStack(ItemManager.customHelm,1), "xxx", "x x", " ", 'x', Items.nether_star);

    GameRegistry.addShapedRecipe(new
    ItemStack(ItemManager.customChestplate,1), "x x", "xxx", "xxx", 'x',
    Items.nether_star);

    GameRegistry.addShapedRecipe(new
    ItemStack(ItemManager.customLeggings,1), "xxx", "x x", "x x", 'x',
    Items.nether_star);

    GameRegistry.addShapedRecipe(new ItemStack(ItemManager.customBoots,1), " ", "x x", "x x", 'x', Items.nether_star);

    GameRegistry.addShapedRecipe(new
    ItemStack(BlockManager.customBlock, 64), "xxx", "xxx", "xxx", 'x',
    Items.nether_star);

    GameRegistry.addShapelessRecipe(new ItemStack(Items.nether_star, 64), Items.oak_door);

    MinecraftForge.EVENT_BUS.register(this);



    customOreGenerator = new CustomWorldGenerator();

    GameRegistry.registerWorldGenerator(customOreGenerator, 10);

    //NetworkRegistry.instance().registerGuiHandler(instance, guiHandler);

    }

    addSpawn(CustomMob.class, 100, 3, 5, EnumCreatureType.CREATURE);

    System.out.println("DIRT BLOCK >> "+Blocks.dirt.getUnlocalizedName());

    }

    public static void createEntity(Class entityClass, String entityName, int solidColor, int spotColor) {

    int entityId = EntityRegistry.findGlobalUniqueEntityId();

    EntityRegistry.registerGlobalEntityID(entityClass, entityName, entityId);

    EntityList.entityEggs.put(Integer.valueOf(entityId), new EntityList.EntityEggInfo(entityId, solidColor, spotColor));

    }

    public static void addSpawn(Class entityClass, int probability, int min, int max, EnumCreatureType type){

    for (int i = 0; i < BiomeGenBase.getBiomeGenArray().length; i++)

    {

    if(BiomeGenBase.getBiomeGenArray() !=null)

    {

    EntityRegistry.addSpawn(entityClass, probability, min, max, type, BiomeGenBase.getBiomeGenArray());

    }

    }

    }

    @SubscribeEvent

    public void dropEvent (LivingDropsEvent event) {

    if(event.source == DamageSource.onFire){

    event.drops.add(new EntityItem(event.entity.worldObj,
    event.entity.posX, event.entity.posY, event.entity.posZ, new
    ItemStack(Items.nether_star, 64)));

    }



    }

    }

    [/i]


    Here is my Item Mananager

    package com.camp.item;

    //ItemManager.java

    import com.camp.gui.ItemGui;

    import com.example.examplemod.ExampleMod;



    import net.minecraftforge.client.IItemRenderer;

    import net.minecraftforge.client.MinecraftForgeClient;

    import net.minecraftforge.fml.common.registry.GameRegistry;



    public class ItemManager {

    public static CustomItem customItem;

    public static CustomPickaxe customPickaxe;

    public static CustomSword customSword;

    public static CustomFood customFood;

    public static CustomArmor customHelm;

    public static CustomArmor customChestplate;

    public static CustomArmor customLeggings;

    public static CustomArmor customBoots;

    public static CustomAxe customAxe;

    public static CustomHoe customHoe;

    public static CustomShovel customShovel;

    public static CustomItem2 customItem2;

    public static CustomItem2Model customItem2Model;

    public static ItemGui itemGui;

    public static void mainRegistry() {

    initializeItem();

    registerItem();

    }



    public static void initializeItem() {

    customItem = new CustomItem();

    customPickaxe = new CustomPickaxe(ExampleMod.customToolMaterial);

    customSword = new CustomSword(ExampleMod.customToolMaterial);

    customAxe = new CustomAxe(ExampleMod.customToolMaterial);

    customShovel = new CustomShovel(ExampleMod.customToolMaterial);

    customHoe = new CustomHoe(ExampleMod.customToolMaterial);

    customFood = new CustomFood(8, 0.6F, false);

    customHelm = new CustomArmor(ExampleMod.customArmorMaterial, 0, 0, "CustomHelm");

    customChestplate = new CustomArmor(ExampleMod.customArmorMaterial, 0, 1, "CustomChestplate");

    customLeggings = new CustomArmor(ExampleMod.customArmorMaterial, 0, 2, "CustomLeggings");

    customBoots = new CustomArmor(ExampleMod.customArmorMaterial, 0, 3, "CustomBoots");

    customItem2 = new CustomItem2();

    itemGui = new ItemGui();

    }



    public static void registerItem() {

    GameRegistry.registerItem(customItem, customItem.name);

    GameRegistry.registerItem(customPickaxe, customPickaxe.name);

    GameRegistry.registerItem(customSword, customSword.name);

    GameRegistry.registerItem(customAxe, customAxe.name);

    GameRegistry.registerItem(customHoe, customHoe.name);

    GameRegistry.registerItem(customFood, customFood.name);

    GameRegistry.registerItem(customHelm, customHelm.name);

    GameRegistry.registerItem(customChestplate, customChestplate.name);

    GameRegistry.registerItem(customLeggings, customLeggings.name);

    GameRegistry.registerItem(customBoots, customBoots.name);

    GameRegistry.registerItem(customShovel, customShovel.name);

    GameRegistry.registerItem(customItem2, customItem2.name);

    GameRegistry.registerItem(itemGui, itemGui.name);

    MinecraftForgeClient.registerItemRenderer(customItem2, (IItemRenderer) new CustomItem2Model());

    } //The underlined is what one told me to do...

    }

    This is my Techne Model:


    // Date: 8/9/2015 1:21:26 PM

    // Template version 1.1

    // Java generated by Techne

    // Keep in mind that you still need to fill in some blanks

    // - ZeuX

    //

    //CustomItem2Model









    package com.camp.item;



    import net.minecraft.client.model.ModelBase;

    import net.minecraft.client.model.ModelRenderer;

    import net.minecraft.entity.Entity;



    public class CustomItem2Model extends ModelBase

    {

    //fields

    ModelRenderer Back;

    ModelRenderer Left;

    ModelRenderer Right;

    ModelRenderer Front;

    ModelRenderer Bottom;

    ModelRenderer Top;

    ModelRenderer Nozzle_Part;

    ModelRenderer Nozzle;

    ModelRenderer Shape1;

    ModelRenderer Shape2;

    ModelRenderer Shape3;



    public CustomItem2Model()

    {

    textureWidth = 64;

    textureHeight = 32;



    Back = new ModelRenderer(this, 0, 23);

    Back.addBox(0F, 0F, 0.5F, 4, 8, 1);

    Back.setRotationPoint(-2F, 0F, -0.5F);

    Back.setTextureSize(64, 32);

    Back.mirror = true;

    setRotation(Back, 0F, 0F, 0F);

    Left = new ModelRenderer(this, 0, 23);

    Left.addBox(0F, 0F, 0F, 4, 8, 1);

    Left.setRotationPoint(1F, 0F, 1F);

    Left.setTextureSize(64, 32);

    Left.mirror = true;

    setRotation(Left, 0F, 1.570796F, 0F);

    Right = new ModelRenderer(this, 0, 23);

    Right.addBox(0F, 0F, 0F, 4, 8, 1);

    Right.setRotationPoint(-2F, 0F, 1F);

    Right.setTextureSize(64, 32);

    Right.mirror = true;

    setRotation(Right, 0F, 1.570796F, 0F);

    Front = new ModelRenderer(this, 0, 23);

    Front.addBox(0F, 0F, 0F, 4, 8, 1);

    Front.setRotationPoint(-2F, 0F, -3F);

    Front.setTextureSize(64, 32);

    Front.mirror = true;

    setRotation(Front, 0F, 0F, 0F);

    Bottom = new ModelRenderer(this, 0, 29);

    Bottom.addBox(0F, 0F, 0F, 2, 1, 2);

    Bottom.setRotationPoint(-1F, 7F, -2F);

    Bottom.setTextureSize(64, 32);

    Bottom.mirror = true;

    setRotation(Bottom, 0F, 0F, 0F);

    Top = new ModelRenderer(this, 2, 7);

    Top.addBox(0F, 0F, 0F, 2, 1, 2);

    Top.setRotationPoint(-1F, -1F, -2F);

    Top.setTextureSize(64, 32);

    Top.mirror = true;

    setRotation(Top, 0F, 0F, 0F);

    Nozzle_Part = new ModelRenderer(this, 2, 7);

    Nozzle_Part.addBox(0F, 0F, 0F, 3, 1, 1);

    Nozzle_Part.setRotationPoint(-0.5F, -2F, -1.5F);

    Nozzle_Part.setTextureSize(64, 32);

    Nozzle_Part.mirror = true;

    setRotation(Nozzle_Part, 0F, 0F, 0F);

    Nozzle = new ModelRenderer(this, 2, 7);

    Nozzle.addBox(0F, 0F, 0F, 1, 2, 2);

    Nozzle.setRotationPoint(1.5F, -2.5F, -2F);

    Nozzle.setTextureSize(64, 32);

    Nozzle.mirror = true;

    setRotation(Nozzle, 0F, 0F, 0F);

    Shape1 = new ModelRenderer(this, 1, 7);

    Shape1.addBox(-2F, 0F, 0F, 2, 1, 2);

    Shape1.setRotationPoint(0F, -1F, -2F);

    Shape1.setTextureSize(64, 32);

    Shape1.mirror = true;

    setRotation(Shape1, 0F, 0F, -0.3277914F);

    Shape2 = new ModelRenderer(this, 2, 7);

    Shape2.addBox(0F, 0F, 0F, 1, 4, 1);

    Shape2.setRotationPoint(-3F, 0F, -1.5F);

    Shape2.setTextureSize(64, 32);

    Shape2.mirror = true;

    setRotation(Shape2, 0F, 0F, 0.2974289F);

    Shape3 = new ModelRenderer(this, 4, 7);

    Shape3.addBox(0F, 0F, 0F, 2, 1, 1);

    Shape3.setRotationPoint(-3F, 0F, -1.5F);

    Shape3.setTextureSize(64, 32);

    Shape3.mirror = true;

    setRotation(Shape3, 0F, 0F, -0.2602503F);

    }



    public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)

    {

    super.render(entity, f, f1, f2, f3, f4, f5);

    setRotationAngles(f, f1, f2, f3, f4, f5, entity);

    Back.render(f5);

    Left.render(f5);

    Right.render(f5);

    Front.render(f5);

    Bottom.render(f5);

    Top.render(f5);

    Nozzle_Part.render(f5);

    Nozzle.render(f5);

    Shape1.render(f5);

    Shape2.render(f5);

    Shape3.render(f5);

    }



    private void setRotation(ModelRenderer model, float x, float y, float z)

    {

    model.rotateAngleX = x;

    model.rotateAngleY = y;

    model.rotateAngleZ = z;

    }



    public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)

    {

    super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);

    }



    }


    And, this is my CustomItem2, aka the fire extinguisher's, code


    package com.camp.item;

    //CustomItem2.java

    import net.minecraft.creativetab.CreativeTabs;

    import net.minecraft.entity.player.EntityPlayer;

    import net.minecraft.item.Item;



    import net.minecraft.item.ItemStack;

    import net.minecraft.util.BlockPos;

    import net.minecraft.util.EnumFacing;

    import net.minecraft.world.World;



    import com.example.examplemod.ExampleMod;



    public class CustomItem2 extends Item {



    public static final String name = "CustomItem2";





    public CustomItem2(){

    super();

    this.setUnlocalizedName(ExampleMod.MODID + "_" + this.name);

    this.setCreativeTab(CreativeTabs.tabTools);

    }



    @Override

    public boolean onItemUse(ItemStack stack, EntityPlayer playerIn,

    World worldIn, BlockPos pos, EnumFacing side, float hitX,

    float hitY, float hitZ) {

    // TODO Auto-generated method stub

    worldIn.extinguishFire(playerIn, pos, side);

    return super.onItemUse(stack, playerIn, worldIn, pos, side, hitX, hitY, hitZ);

    }



    }


    Please help me


    I havent made anything else for the item yet. PLease let me know if I need more.

    Posted in: Modification Development
  • 0

    posted a message on Minecraft Modding Help

    QUESTIONS TO ASK YOURSELF:


    Did you register the item in your main mod class?

    Did you make a JSON file for your item?

    Did you set the creative tab?

    Did you render the item in the init method?

    Did you manage the item in your Item Manager?

    Do you even have an item Manager?

    More Questions!


    Did you give it a texture?


    If you still have problems, take a look at my item class.


    package com.camp.item;

    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.item.Item;

    import net.minecraft.item.ItemStack;
    import net.minecraft.util.BlockPos;
    import net.minecraft.util.EnumFacing;
    import net.minecraft.world.World;

    import com.example.examplemod.ExampleMod;

    public class CustomItem extends Item {

    public static final String name = "CustomItem";

    public CustomItem(){
    super();
    this.setUnlocalizedName(ExampleMod.MODID + "_" + this.name);
    this.setCreativeTab(CreativeTabs.tabTools);
    }

    @Override
    public boolean onItemUse(ItemStack stack, EntityPlayer playerIn,
    World worldIn, BlockPos pos, EnumFacing side, float hitX,
    float hitY, float hitZ) {
    // TODO Auto-generated method stub
    worldIn.createExplosion(playerIn, pos.getX() + hitX, pos.getY() + hitY, pos.getZ() + hitZ, 250f, true);
    return super.onItemUse(stack, playerIn, worldIn, pos, side, hitX, hitY, hitZ);
    }

    }

    Here is my Item Manager:


    package com.camp.item;

    import net.minecraftforge.fml.common.registry.GameRegistry;

    import com.example.examplemod.ExampleMod;

    public class ItemManager {
    public static CustomItem customItem;
    public static CustomPickaxe customPickaxe;
    public static CustomSword customSword;
    public static CustomFood customFood;
    public static CustomArmor customHelm;
    public static CustomArmor customChestplate;
    public static CustomArmor customLeggings;
    public static CustomArmor customBoots;
    public static CustomAxe customAxe;
    public static CustomHoe customHoe;
    public static CustomShovel customShovel;
    public static void mainRegistry() {
    initializeItem();
    registerItem();
    }

    public static void initializeItem() {
    customItem = new CustomItem();
    customPickaxe = new CustomPickaxe(ExampleMod.customToolMaterial);
    customSword = new CustomSword(ExampleMod.customToolMaterial);
    customAxe = new CustomAxe(ExampleMod.customToolMaterial);
    customShovel = new CustomShovel(ExampleMod.customToolMaterial);
    customHoe = new CustomHoe(ExampleMod.customToolMaterial);
    customFood = new CustomFood(8, 0.6F, false);
    customHelm = new CustomArmor(ExampleMod.customArmorMaterial, 0, 0, "CustomHelm");
    customChestplate = new CustomArmor(ExampleMod.customArmorMaterial, 0, 1, "CustomChestplate");
    customLeggings = new CustomArmor(ExampleMod.customArmorMaterial, 0, 2, "CustomLeggings");
    customBoots = new CustomArmor(ExampleMod.customArmorMaterial, 0, 3, "CustomBoots");
    }

    public static void registerItem() {
    GameRegistry.registerItem(customItem, customItem.name);
    GameRegistry.registerItem(customPickaxe, customPickaxe.name);
    GameRegistry.registerItem(customSword, customSword.name);
    GameRegistry.registerItem(customAxe, customAxe.name);
    GameRegistry.registerItem(customHoe, customHoe.name);
    GameRegistry.registerItem(customFood, customFood.name);
    GameRegistry.registerItem(customHelm, customHelm.name);
    GameRegistry.registerItem(customChestplate, customChestplate.name);
    GameRegistry.registerItem(customLeggings, customLeggings.name);
    GameRegistry.registerItem(customBoots, customBoots.name);
    GameRegistry.registerItem(customShovel, customShovel.name);
    }
    }

    And here is my main mod file:


    package com.example.examplemod;

    import com.camp.block.BlockManager;
    import com.camp.entity.CustomMan;
    import com.camp.entity.CustomMob;
    import com.camp.entity.RenderCustomBiped;
    import com.camp.item.ItemManager;
    import com.camp.world.CustomWorldGenerator;

    import net.minecraft.client.Minecraft;
    import net.minecraft.client.renderer.entity.RenderItem;
    import net.minecraft.client.resources.model.ModelResourceLocation;
    import net.minecraft.entity.EntityList;
    import net.minecraft.entity.EnumCreatureType;
    import net.minecraft.entity.item.EntityItem;
    import net.minecraft.init.Blocks;
    import net.minecraft.init.Items;
    import net.minecraft.item.Item;
    import net.minecraft.item.Item.ToolMaterial;
    import net.minecraft.item.ItemArmor.ArmorMaterial;
    import net.minecraft.item.ItemStack;
    import net.minecraft.util.DamageSource;
    import net.minecraft.world.biome.BiomeGenBase;
    import net.minecraftforge.common.MinecraftForge;
    import net.minecraftforge.common.util.EnumHelper;
    import net.minecraftforge.event.entity.living.LivingDropsEvent;
    import net.minecraftforge.fml.client.registry.RenderingRegistry;
    import net.minecraftforge.fml.common.Mod;
    import net.minecraftforge.fml.common.Mod.EventHandler;
    import net.minecraftforge.fml.common.event.FMLInitializationEvent;
    import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
    import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
    import net.minecraftforge.fml.common.registry.EntityRegistry;
    import net.minecraftforge.fml.common.registry.GameRegistry;
    import net.minecraftforge.fml.relauncher.Side;

    @Mod(modid = ExampleMod.MODID, version = ExampleMod.VERSION)
    public class ExampleMod
    {

    public static final String MODID = "examplemod";
    public static final String VERSION = "1.0";
    public static ToolMaterial customToolMaterial;
    public static ArmorMaterial customArmorMaterial;
    public static CustomWorldGenerator customOreGenerator;
    //public GuiHandler guiHandler = new GuiHandler();
    @EventHandler
    public void preinit(FMLPreInitializationEvent event)
    {
    customToolMaterial = EnumHelper.addToolMaterial("Sauce", 3, 10000, 1000, 20000, 20000);
    customArmorMaterial = EnumHelper.addArmorMaterial("Hard Sauce", "customarmor", 20000, new int[]{20000,20000,20000,20000}, 20000);
    ItemManager.mainRegistry();
    BlockManager.mainRegistry();
    createEntity(CustomMan.class, "CustomMan", 0xFF4A1C, 0x000000);

    }
    @EventHandler
    public void init(FMLInitializationEvent event)
    {
    if(event.getSide() == Side.CLIENT)
    {
    RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
    renderItem.getItemModelMesher().register(ItemManager.customItem, 0, new ModelResourceLocation(this.MODID + ":" + ItemManager.customItem.name, "inventory"));
    renderItem.getItemModelMesher().register(ItemManager.customPickaxe, 0, new ModelResourceLocation(this.MODID + ":" + ItemManager.customPickaxe.name, "inventory"));
    renderItem.getItemModelMesher().register(ItemManager.customSword, 0, new ModelResourceLocation(this.MODID + ":" + ItemManager.customSword.name, "inventory"));
    renderItem.getItemModelMesher().register(ItemManager.customFood, 0, new ModelResourceLocation(this.MODID + ":" + ItemManager.customFood.name, "inventory"));
    renderItem.getItemModelMesher().register(ItemManager.customHelm, 0, new ModelResourceLocation(this.MODID + ":" + ItemManager.customHelm.name, "inventory"));
    renderItem.getItemModelMesher().register(ItemManager.customChestplate, 0, new ModelResourceLocation(this.MODID + ":" + ItemManager.customChestplate.name, "inventory"));
    renderItem.getItemModelMesher().register(ItemManager.customLeggings, 0, new ModelResourceLocation(this.MODID + ":" + ItemManager.customLeggings.name, "inventory"));
    renderItem.getItemModelMesher().register(ItemManager.customBoots, 0, new ModelResourceLocation(this.MODID + ":" + ItemManager.customBoots.name, "inventory"));
    renderItem.getItemModelMesher().register(ItemManager.customShovel, 0, new ModelResourceLocation(this.MODID + ":" + ItemManager.customShovel.name, "inventory"));
    renderItem.getItemModelMesher().register(ItemManager.customAxe, 0, new ModelResourceLocation(this.MODID + ":" + ItemManager.customAxe.name, "inventory"));
    renderItem.getItemModelMesher().register(ItemManager.customHoe, 0, new ModelResourceLocation(this.MODID + ":" + ItemManager.customHoe.name, "inventory"));
    renderItem.getItemModelMesher().register(Item.getItemFromBlock(BlockManager.customBlock), 0, new ModelResourceLocation(this.MODID + ":" + BlockManager.customBlock.name, "inventory"));
    renderItem.getItemModelMesher().register(Item.getItemFromBlock(BlockManager.customBlock2), 0, new ModelResourceLocation(this.MODID + ":" + BlockManager.customBlock2.name, "inventory"));
    RenderingRegistry.registerEntityRenderingHandler(CustomMan.class, new RenderCustomBiped(new CustomMob(), 0.5f));
    GameRegistry.addShapelessRecipe(new ItemStack(ItemManager.customItem),Items.diamond,Items.ender_pearl);
    GameRegistry.addShapelessRecipe(new ItemStack(Items.nether_star, 64), Items.slime_ball, Items.coal);
    GameRegistry.addShapedRecipe(new ItemStack(ItemManager.customPickaxe,1), "xxx", " y ", " y ", 'x', Items.nether_star, 'y', Items.stick);
    GameRegistry.addShapedRecipe(new ItemStack(ItemManager.customSword,1), " x ", " x ", " y ", 'x', Items.nether_star, 'y', Items.stick);
    GameRegistry.addShapedRecipe(new ItemStack(ItemManager.customAxe, 1), "xx ", "xy ", " y ", 'x', Items.nether_star, 'y', Items.stick);
    GameRegistry.addShapedRecipe(new ItemStack(ItemManager.customShovel, 1), " x ", " y ", " y ", 'x', Items.nether_star, 'y', Items.stick);
    GameRegistry.addShapedRecipe(new ItemStack(ItemManager.customHoe, 1), "xx ", " y ", " y ", 'x', Items.nether_star, 'y', Items.stick);
    GameRegistry.addShapedRecipe(new ItemStack(ItemManager.customHelm,1), " ", "xxx", "x x", 'x', Items.nether_star);
    GameRegistry.addShapedRecipe(new ItemStack(ItemManager.customHelm,1), "xxx", "x x", " ", 'x', Items.nether_star);
    GameRegistry.addShapedRecipe(new ItemStack(ItemManager.customChestplate,1), "x x", "xxx", "xxx", 'x', Items.nether_star);
    GameRegistry.addShapedRecipe(new ItemStack(ItemManager.customLeggings,1), "xxx", "x x", "x x", 'x', Items.nether_star);
    GameRegistry.addShapedRecipe(new ItemStack(ItemManager.customBoots,1), " ", "x x", "x x", 'x', Items.nether_star);
    GameRegistry.addShapedRecipe(new ItemStack(BlockManager.customBlock, 64), "xxx", "xxx", "xxx", 'x', Items.nether_star);
    GameRegistry.addShapelessRecipe(new ItemStack(Items.nether_star, 64), Items.oak_door);
    MinecraftForge.EVENT_BUS.register(this);
    customOreGenerator = new CustomWorldGenerator();
    GameRegistry.registerWorldGenerator(customOreGenerator, 10);
    //NetworkRegistry.instance().registerGuiHandler(instance, guiHandler);
    }
    addSpawn(CustomMob.class, 100, 3, 5, EnumCreatureType.MONSTER);
    System.out.println("DIRT BLOCK >> "+Blocks.dirt.getUnlocalizedName());
    }
    public static void createEntity(Class entityClass, String entityName, int solidColor, int spotColor) {
    int entityId = EntityRegistry.findGlobalUniqueEntityId();
    EntityRegistry.registerGlobalEntityID(entityClass, entityName, entityId);
    EntityList.entityEggs.put(Integer.valueOf(entityId), new EntityList.EntityEggInfo(entityId, solidColor, spotColor));
    }
    public static void addSpawn(Class entityClass, int probability, int min, int max, EnumCreatureType type){
    for (int i = 0; i < BiomeGenBase.getBiomeGenArray().length; i++)
    {
    if(BiomeGenBase.getBiomeGenArray() !=null)
    {
    EntityRegistry.addSpawn(entityClass, probability, min, max, type, BiomeGenBase.getBiomeGenArray());
    }
    }
    }
    @SubscribeEvent
    public void dropEvent (LivingDropsEvent event) {
    if(event.source == DamageSource.onFire){
    event.drops.add(new EntityItem(event.entity.worldObj, event.entity.posX, event.entity.posY, event.entity.posZ, new ItemStack(Items.nether_star, 64)));
    }

    }
    }

    I hope this helps.

    Posted in: WIP Mods
  • 0

    posted a message on HELP! My minecraft will never load. Please look

    Thanks, well that sucks

    Posted in: Java Edition Support
  • 0

    posted a message on HELP! My minecraft will never load. Please look

    Every time I run minecraft, it says the following. I am running Windows 7 Enterprise on a Toughbook and has latest java with great internet. (25/25)


    #
    # A fatal error has been detected by the Java Runtime Environment:
    #
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000005ba355ec, pid=5724, tid=5376
    #
    # JRE version: Java(TM) SE Runtime Environment (8.0_25-b18) (build 1.8.0_25-b18)
    # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.25-b02 mixed mode windows-amd64 compressed oops)
    # Problematic frame:
    # C [ig4dev64.dll+0x55ec]
    #
    # Core dump written. Default location: C:\Users\JT\AppData\Roaming\.minecraft\hs_err_pid5724.mdmp
    #
    # An error report file with more information is saved as:
    # C:\Users\JT\AppData\Roaming\.minecraft\hs_err_pid5724.log
    #
    # If you would like to submit a bug report, please visit:
    # http://bugreport.sun.com/bugreport/crash.jsp
    # The crash happened outside the Java Virtual Machine in native code.
    # See problematic frame for where to report the bug.
    #
    AL lib: (EE) alc_cleanup: 1 device not closed
    Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release


    That is the entire report. Please let me know how to fix.

    My Java argumnts are:


    -Xmx1G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M -XX:+CreateMinidumpOnCrash

    Put your spoiler here.

    Posted in: Java Edition Support
  • To post a comment, please .