Jump to content

Mickii26

Members
  • Posts

    8
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Mickii26's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Thanks for all the help at a close look to my main class and the advice i have been given i found out what was wrong, so thanks for the help everyone.
  2. and a bit further down So when I look at GameRegistry.java lines 215 and 233, I find try { assert block != null : "registerBlock: block cannot be null"; assert itemclass != null : "registerBlock: itemclass cannot be null"; int blockItemId = block.blockID - 256; // line 215 Constructor<? extends ItemBlock> itemCtor; Item i; // .. some extra code removed ... } catch (Exception e) { FMLLog.log(Level.SEVERE, e, "Caught an exception during block registration"); throw new LoaderException(e); //line 233 } Which means that an error occurred on line 215, it threw an exception which was caught at line 233 and re-thrown. The error in the log is "null pointer exception", which means you tried to use a variable which wasn't initialised. In this case, the only possible variable on line 215 which could cause that is block. The stack trace also shows me that GameRegistry.java line 233 was called from line 196, which was called from line 172, which was called from your ModPack.java line 67. line 172 is inside this function public static void registerBlock(net.minecraft.block.Block block, String name) so I can be pretty sure that your ModPack.java line 67 looks something like registerBlock(myBlock, "mymod:myblock"); and that you've previously declared MyNewBlock myBlock; but forgotten to do myBlock = new MyNewBlock(number, material); -TGG it fixed the crash, but it still dosnt load the texture, but thanks for the help on the crash note
  3. is it possible anyone of you can make a java class i can import and see if that works??
  4. here is the crash report: ---- Minecraft Crash Report ---- // You should try our sister game, Minceraft! Time: 23-12-13 18:28 Description: There was a severe problem during mod loading that has caused the game to fail cpw.mods.fml.common.LoaderException: java.lang.NullPointerException at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:233) at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:196) at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:172) at ModPack.ModPack.load(ModPack.java:67) 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:545) 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:313) 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:201) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:181) 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:313) 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:112) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:699) at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:249) at net.minecraft.client.Minecraft.startGame(Minecraft.java:509) at net.minecraft.client.Minecraft.run(Minecraft.java:808) at net.minecraft.client.main.Main.main(Main.java:93) 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 net.minecraft.launchwrapper.Launch.launch(Launch.java:131) at net.minecraft.launchwrapper.Launch.main(Launch.java:27) Caused by: java.lang.NullPointerException at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:215) ... 40 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.6.4 Operating System: Windows 8 (amd64) version 6.2 Java Version: 1.7.0_45, Oracle Corporation Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 869074392 bytes (828 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Suspicious classes: FML and Forge are installed IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v8.11 FML v6.4.45.953 Minecraft Forge 9.11.1.953 4 mods loaded, 4 mods active mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized FML{6.4.45.953} [Forge Mod Loader] (bin) Unloaded->Constructed->Pre-initialized->Initialized Forge{9.11.1.953} [Minecraft Forge] (bin) Unloaded->Constructed->Pre-initialized->Initialized ModPackInof.ID{ModPackInfo.VERS} [ModPackInfo.NAME] (bin) Unloaded->Constructed->Pre-initialized->Errored
  5. then i try public Redgemore(int par1, String texture) { super(par1, Material.iron); setCreativeTab(CreativeTabs.tabBlock); } //into public Redgemore(int par1, Material material) { super(par1, Material.iron); setCreativeTab(CreativeTabs.tabBlock); setTextureName("modpack:Redgem_ore"); } my game crashes if it helps im gonna show you the main javaclass package ModPack; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.EnumToolMaterial; import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraftforge.common.EnumHelper; import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; import net.minecraft.item.EnumToolMaterial; import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraftforge.common.EnumHelper; 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.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; import ModPack.Projector; @Mod(modid="ModPackInof.ID",name="ModPackInfo.NAME",version="ModPackInfo.VERS") @NetworkMod(clientSideRequired=true,serverSideRequired=false) public class ModPack { public static final String modid = "ModPack"; @Instance(modid) public static ModPack instance; /* * ToolMaterial */ //Telling forge that we are creating these //items public static Item Redgem; public static Item RedgemPickaxe; //Blocks public static Block Redgemblock; public static Block Redgemore; public static Block Bluecobblestoneblock; public static Block Bluestoneblock; public final static Block Projector = new Projector(200, Material.rock); //tools //Declaring Init @Init public void load(FMLInitializationEvent event){ // define items RedgemPickaxe= new Items(2004).setUnlocalizedName("RedgemPickaxe"); Redgem = new Items(2000).setUnlocalizedName("Redgem"); // define blocks Redgemblock = new Redgemblock(2001, "Redgemblock").setUnlocalizedName("Redgem_block").setHardness(3.0F).setStepSound(Block.soundMetalFootstep).setResistance(15.0F); GameRegistry.registerBlock(Redgemblock, "Redgemblock"); Redgemore = new Redgemore(200, Material.iron).setUnlocalizedName("Redgem_block").setCreativeTab(CreativeTabs.tabBlock).setTextureName("modpack:Redgem_ore").setHardness(3.0F).setStepSound(Block.soundMetalFootstep).setResistance(15.0F); GameRegistry.registerBlock(Redgemore, "Redgemore"); Bluecobblestoneblock = new Bluecobblestoneblock(2002, "Bluecobblestoneblock").setUnlocalizedName("Bluecobblestone_block").setHardness(3.0F).setStepSound(Block.soundMetalFootstep).setResistance(15.0F); GameRegistry.registerBlock(Bluecobblestoneblock, "Bluecobblestoneblock"); Bluestoneblock = new Bluestoneblock(2003, "Bluestoneblock").setUnlocalizedName("Bluestone_block").setHardness(3.0F).setStepSound(Block.soundMetalFootstep).setResistance(15.0F); GameRegistry.registerBlock(Bluestoneblock, "Bluestoneblock"); GameRegistry.registerBlock(Projector,"Projector"); //adding names //items LanguageRegistry.addName(RedgemPickaxe, "RedgemPickaxe"); LanguageRegistry.addName(Redgem, "Redgem"); //blocks LanguageRegistry.addName(Redgemblock, "Block of Redgem"); LanguageRegistry.addName(Redgemore,"Redgem ore"); LanguageRegistry.addName(Bluecobblestoneblock, "Bluecobblestone"); LanguageRegistry.addName(Bluestoneblock, "Bluestone"); LanguageRegistry.addName(Bluecobblestoneblock, "Bluecobblestoneblock"); LanguageRegistry.addName(Projector, "Projector"); //crafting GameRegistry.addRecipe(new ItemStack(Redgemblock,1), new Object[]{ "TTT","TTT","TTT",'T',Redgem,}); GameRegistry.addShapelessRecipe(new ItemStack(Redgem,9), new Object[]{ Redgemblock}); //smelting GameRegistry.addSmelting(ModPack.Bluecobblestoneblock.blockID, new ItemStack(Bluestoneblock, 1), 5F); //rendering GameRegistry.registerTileEntity(TileEntityTest.class, "Projector"); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTest.class, new RendererProjector()); } }
  6. i have tried to find a string that allows me to load my texture in the custom folder assets/modpack/texture/block. it looks like this code should work but it dosnt load the texture. Hope someone can tell me why it dosn't work because its really annoying. package ModPack; import java.util.Random; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.registry.LanguageRegistry; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; public class Redgemore extends Block { public Redgemore(int par1, String texture) { super(par1, Material.iron); setCreativeTab(CreativeTabs.tabBlock); } public int idDropped(int par1, Random par2Random, int par3) { return ModPack.Redgem.itemID; } public int quantityDropped(Random random) { return 1; } public void registerIcons(IconRegister reg) { this.blockIcon = reg.registerIcon("modpack:Redgem_ore"); } }
×
×
  • Create New...

Important Information

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