Jump to content

sinsiliuxs120

Members
  • Posts

    9
  • Joined

  • Last visited

Posts posted by sinsiliuxs120

  1. So I want to make placeable vehicle, which you can ride on any block except water or air of course. Where should I start? By creating it's item (on which right-clicking will lead to placing the vehicle), the model or EntityVEHICLENAME?

  2. Hello fellow modders, I have a little question and try to keep it as short as possible.

    So I've planned adding a few vehicles into my mod, but haven't found a tutorial anywhere. If you find any tutorial or would be so kind and explain it to me just let me know, I would be glad. Thanks in advance.

     

    -S

     

    P.S. I've looked up the boat and minecart classes, so save your time and don't suggest looking up to them.

  3. Ok, so here is the BaseMod.class (TdmBase.java) code:

     

     

        package sins.tdm;

       

        import net.minecraft.block.Block;

        import net.minecraft.block.material.Material;

        import net.minecraft.creativetab.CreativeTabs;

        import net.minecraft.item.Item;

        import net.minecraft.item.ItemStack;

        import cpw.mods.fml.common.Mod;

        import cpw.mods.fml.common.Mod.Init;

        import cpw.mods.fml.common.event.FMLInitializationEvent;

        import cpw.mods.fml.common.network.NetworkMod;

        import cpw.mods.fml.common.registry.GameData;

        import cpw.mods.fml.common.registry.GameRegistry;

        import cpw.mods.fml.common.registry.LanguageRegistry;

        import net.minecraft.item.crafting.CraftingManager;

       

        @Mod(modid = TdmBase.modid, name = "Sorry no spoilers :)", version = "1.0")

        @NetworkMod(clientSideRequired = true, serverSideRequired = false)

        public class TdmBase

        {

       

                public static final String modid = "sins_TDM";

             

             

                public static CreativeTabs tabTDM = new CreativeTabs("tabTDM") {

                public ItemStack getIconItemStack() {

                        return new ItemStack(TdmBase.barrel, 1, 0);

                }

        };

             

                public static Block barrel;

                public static Item cog;

                public static Item woodenWheel;

                public static Item reinforcedWheel;

                public static Item smallCannon;

                public static Item woodenChassis;

                public static Item reinforcedChassis;

             

                @Init

                public void load(FMLInitializationEvent event)

                {

                        reinforcedChassis = new ItemReinforcedChassis(7210).setUnlocalizedName("Reinforced chassis");

                        LanguageRegistry.addName(reinforcedChassis, "Reinforced chassis");

                        GameRegistry.addRecipe(new ItemStack(reinforcedChassis), new Object[]{

                        "WIW","CBC","WIW", 'W', TdmBase.reinforcedWheel, 'I', Item.ingotIron, 'C', TdmBase.cog, 'B', Block.blockIron});

       

                        woodenChassis = new ItemWoodenChassis(7209).setUnlocalizedName("Wooden chassis");

                        LanguageRegistry.addName(woodenChassis, "Wooden chassis");

                        GameRegistry.addRecipe(new ItemStack(woodenChassis), new Object[]{

                        "WSW","CPC","WSW", 'W', TdmBase.woodenWheel, 'S', Item.stick, 'C', TdmBase.cog, 'P', Block.planks});

                     

                        smallCannon = new ItemSmallCannon(7208).setUnlocalizedName("Small cannon");

                        LanguageRegistry.addName(smallCannon, "Small cannon");

                        GameRegistry.addRecipe(new ItemStack(smallCannon), new Object[]{

                        "I  "," I ","  I", 'I', Item.ingotIron});

                     

                        reinforcedWheel = new ItemReinforcedWheel(7207).setUnlocalizedName("Reinforced wheel");

                        LanguageRegistry.addName(reinforcedWheel, "Reinforced wheel");

                        GameRegistry.addRecipe(new ItemStack(reinforcedWheel), new Object[]{

                        "III","IPI","III", 'I', Item.ingotIron, 'P', Block.planks});

                     

                        woodenWheel = new ItemWoodenWheel(7206).setUnlocalizedName("Wooden wheel");

                        LanguageRegistry.addName(woodenWheel, "Wooden wheel");

                        GameRegistry.addRecipe(new ItemStack(woodenWheel), new Object[]{

                        "SSS","SPS","SSS", 'P', Block.planks, 'S', Item.stick});

                     

                        cog = new ItemCog(7205).setUnlocalizedName("Cog");

                        LanguageRegistry.addName(cog, "Cog");

                        GameRegistry.addRecipe(new ItemStack(cog), new Object[]{

                    " S ","SPS"," S ", 'I', Block.planks, 'S', Item.stick});

                     

                        barrel = new BlockBarrel(500, Material.grass).setUnlocalizedName("Barrel").setHardness(2.0F).setResistance(0.0F).setStepSound(Block.soundWoodFootstep);

                        GameRegistry.registerBlock(barrel, modid + barrel.getUnlocalizedName2());

                        LanguageRegistry.addName(barrel, "Barrel");

                        GameRegistry.addRecipe(new ItemStack(barrel), new Object[]{

                "PCP","PCP","PCP", 'P', Block.planks, 'C', Item.gunpowder});

                     

                        LanguageRegistry.instance().addStringLocalization("itemGroup.tabTDM", "en_US", "No spoilers :)))");

                }

        }

     

     

     

  4. Here is the error code

    ---- Minecraft Crash Report ----

    // I feel sad now :(

     

    Time: 8/17/13 9:11 PM

    Description: Failed to start game

     

    java.lang.NullPointerException

            at net.minecraft.item.crafting.CraftingManager.addRecipe(CraftingManager.java:213)

            at cpw.mods.fml.common.registry.GameRegistry.addShapedRecipe(GameRegistry.java:244)

            at cpw.mods.fml.common.registry.GameRegistry.addRecipe(GameRegistry.java:239)

            at mod.tdm.TdmBase.load(TdmBase.java:34)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

            at java.lang.reflect.Method.invoke(Unknown Source)

            at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:494)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

            at java.lang.reflect.Method.invoke(Unknown Source)

            at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

            at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

            at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

            at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

            at com.google.common.eventbus.EventBus.post(EventBus.java:267)

            at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:192)

            at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:172)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

            at java.lang.reflect.Method.invoke(Unknown Source)

            at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

            at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

            at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

            at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

            at com.google.common.eventbus.EventBus.post(EventBus.java:267)

            at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:103)

            at cpw.mods.fml.common.Loader.initializeMods(Loader.java:691)

            at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:213)

            at net.minecraft.client.Minecraft.startGame(Minecraft.java:448)

            at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44)

            at net.minecraft.client.Minecraft.run(Minecraft.java:733)

            at java.lang.Thread.run(Unknown Source)

     

  5. So I've encountered this problem when I try to add a crafting recipe for item from my mod using other items from my mod minecraft crashes on start up. Eclipse doesn't show any errors and I'm not sure what to do. All my items are in base mod class as well as their crafting recipes. However items that are crafted with vanilla minecraft items work just fine. If you need any part of code just let me know. Thanks in advance

     

    -S

×
×
  • Create New...

Important Information

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