Jump to content

Can't set name for worldtype


Blade Avuari

Recommended Posts

I am unable to set a name for a my worldtype. Does anyone know what method I'm supposed to use?

 

My mod class

 

package net.minecraft.src;
import java.util.Random;

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.registry.LanguageRegistry;

@Mod( modid = "DigDeeper", name="Digging Deeper!", version="Mod 1.3 MC 1.3.2")
public class BladeDepthMod
{
public  WorldType Deeper;

@Init
public void DepthLoad(FMLInitializationEvent evt)
{
	LanguageRegistry.addName(Deeper, "Dig Deeper!");//This is the method that appears to be the problem
    Deeper = new WorldTypeDeeper(11, "deeper");
}
}

 

 

And the error report

 

 

 

      Minecraft has crashed!     

      ----------------------     

 

Minecraft has stopped running because it encountered a problem; Failed to start game

This error has been saved to C:\Users\Jonathan\Documents\moddingcraft13\jars\.\crash-reports\crash-2012-08-17_14.31.22-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.

 

 

 

--- BEGIN ERROR REPORT b2b0f27 --------

Generated 8/17/12 2:31 PM

 

- Minecraft Version: 1.3.2

- Operating System: Windows 7 (amd64) version 6.1

- Java Version: 1.7.0, Oracle Corporation

- Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

- Memory: 805258432 bytes (767 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)

- JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

- LWJGL: 2.4.2

- OpenGL: GeForce 6150SE nForce 430/PCI/SSE2 GL version 2.1.2, NVIDIA Corporation

- Is Modded: Definitely; 'forge,fml'

- Type: Client

- Texture Pack: Default

- Profiler Position: N/A (disabled)

 

cpw.mods.fml.common.LoaderException: java.lang.reflect.InvocationTargetException

at cpw.mods.fml.common.LoadController.transition(LoadController.java:106)

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

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

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

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

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

Caused by: java.lang.reflect.InvocationTargetException

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:308)

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:69)

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

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

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

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

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

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:69)

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

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

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

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

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

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

... 4 more

Caused by: java.lang.IllegalArgumentException: Illegal object for naming null

at cpw.mods.fml.common.registry.LanguageRegistry.addNameForObject(LanguageRegistry.java:56)

at cpw.mods.fml.common.registry.LanguageRegistry.addName(LanguageRegistry.java:64)

at net.minecraft.src.BladeDepthMod.DepthLoad(BladeDepthMod.java:18)

... 30 more

--- END ERROR REPORT 817eb19f ----------

 

 

 

 

 

width=300 height=100http://i.imgur.com/ivK3J.png[/img]

I'm a little surprised that I am still ranked as a "Forge Modder," having not posted a single mod since my animals mod... I have to complete Digging Deeper!, fast!

Link to comment
Share on other sites

It throws an error, because you try to add a name to an object which isn't initialized yet. You initialize it first after the name register. Try this:

 

@Init
public void DepthLoad(FMLInitializationEvent evt)
{
    Deeper = new WorldTypeDeeper(11, "deeper");
	LanguageRegistry.addName(Deeper, "Dig Deeper!");
}

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

It doesn't help, it just says "Illegal object for naming"

 

Code:

package net.minecraft.src;
import java.util.Random;

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.registry.LanguageRegistry;

@Mod( modid = "DigDeeper", name="Digging Deeper!", version="Mod 1.3 MC 1.3.2")
public class BladeDepthMod
{
public  WorldType Deeper;

@Init
public void DepthLoad(FMLInitializationEvent evt)
{
	Deeper = new WorldTypeDeeper(11, "deeper");
    LanguageRegistry.addName(Deeper, "Dig Deeper!");
}
}

 

Error:

 


      Minecraft has crashed!      
      ----------------------      

Minecraft has stopped running because it encountered a problem; Failed to start game
This error has been saved to C:\Users\Jonathan\Documents\moddingcraft13\jars\.\crash-reports\crash-2012-08-17_15.25.08-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.



--- BEGIN ERROR REPORT eb26e2b --------
Generated 8/17/12 3:25 PM

- Minecraft Version: 1.3.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0, Oracle Corporation
- Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 799626448 bytes (762 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
- JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
- LWJGL: 2.4.2
- OpenGL: GeForce 6150SE nForce 430/PCI/SSE2 GL version 2.1.2, NVIDIA Corporation
- Is Modded: Definitely; 'forge,fml'
- Type: Client
- Texture Pack: Default
- Profiler Position: N/A (disabled)

cpw.mods.fml.common.LoaderException: java.lang.reflect.InvocationTargetException
at cpw.mods.fml.common.LoadController.transition(LoadController.java:106)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:603)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:217)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:447)
at net.minecraft.client.Minecraft.run(Minecraft.java:734)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
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:308)
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:69)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
at com.google.common.eventbus.EventBus.post(EventBus.java:268)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:127)
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:69)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
at com.google.common.eventbus.EventBus.post(EventBus.java:268)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:85)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:602)
... 4 more
Caused by: java.lang.IllegalArgumentException: Illegal object for naming net.minecraft.src.WorldTypeDeeper@68d4ea21
at cpw.mods.fml.common.registry.LanguageRegistry.addNameForObject(LanguageRegistry.java:56)
at cpw.mods.fml.common.registry.LanguageRegistry.addName(LanguageRegistry.java:64)
at net.minecraft.src.BladeDepthMod.DepthLoad(BladeDepthMod.java:19)
... 30 more
--- END ERROR REPORT 1d7c6171 ----------


 

 

width=300 height=100http://i.imgur.com/ivK3J.png[/img]

I'm a little surprised that I am still ranked as a "Forge Modder," having not posted a single mod since my animals mod... I have to complete Digging Deeper!, fast!

Link to comment
Share on other sites

Then try instead of this:

LanguageRegistry.addName(Deeper, "Dig Deeper!");

, this:

LanguageRegistry.instance().addStringLocalization("deeper.name", "en_US", "Dig Deeper!");

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

Pretty close, it ran, but the name was "generator.deeper", so naturally, I used this:

LanguageRegistry.instance().addStringLocalization("generator.deeper", "en_US", "Dig Deeper!");

Thanks so very much! This is going to help alot with everything.

 

It seems that I still get the error when I use the normal minecraft client:

Error:

 


      Minecraft has crashed!      
      ----------------------      

Minecraft has stopped running because it encountered a problem; Failed to start game
This error has been saved to C:\Users\Jonathan\Awesomecraft\instances\Minecraft1.3\.minecraft\crash-reports\crash-2012-08-17_16.12.42-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.



--- BEGIN ERROR REPORT c920650b --------
Generated 8/17/12 4:12 PM

- Minecraft Version: 1.3.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.6.0_25, Sun Microsystems Inc.
- Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Sun Microsystems Inc.
- Memory: 416241624 bytes (396 MB) / 514523136 bytes (490 MB) up to 954466304 bytes (910 MB)
- JVM Flags: 2 total; -Xmx1024m -Xms512m
- LWJGL: 2.4.2
- OpenGL: GeForce 6150SE nForce 430/PCI/SSE2 GL version 2.1.2, NVIDIA Corporation
- Is Modded: Definitely; 'forge,fml'
- Type: Client
- Texture Pack: Default
- Profiler Position: N/A (disabled)

java.lang.NullPointerException
at cpw.mods.fml.common.FMLModContainer.getName(FMLModContainer.java:106)
at cpw.mods.fml.common.Loader.sortModList(Loader.java:236)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:416)
at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:192)
at net.minecraft.client.Minecraft.a(Minecraft.java:402)
at net.minecraft.client.Minecraft.run(Minecraft.java:734)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 610227f2 ----------

 

width=300 height=100http://i.imgur.com/ivK3J.png[/img]

I'm a little surprised that I am still ranked as a "Forge Modder," having not posted a single mod since my animals mod... I have to complete Digging Deeper!, fast!

Link to comment
Share on other sites

I think you need a mcmod.info file in your package. Dunno how it works, because I'm not nearly done with my mods that I need it now.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

Yeah, that was the problem. I thought about it just after I posted, but I had to search for the file. One of your posts solved THAT, too.

There needs to be a link of at least an easy way to find it here in the Modder Support forum.

width=300 height=100http://i.imgur.com/ivK3J.png[/img]

I'm a little surprised that I am still ranked as a "Forge Modder," having not posted a single mod since my animals mod... I have to complete Digging Deeper!, fast!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Baba  Serege [[+27-73 590 8989]] has experience of 27 years in helping and guiding many people from all over the world. His psychic abilities may help you answer and resolve many unanswered questions. He specialize in helping women and men from all walks of life.. 1) – Bring back lost lover. even if lost for a long time. 2) – My lover is abusing alcohol, partying and cheating on me I urgently need help” 3) – Divorce or court issues. 4) – Is your love falling apart? 5) – Do you want your love to grow stronger? 6) – Is your partner losing interest in you? 7) – Do you want to catch your partner cheating on you? – We help to keep your partner faithful and loyal to you. 9) – We recover love and happiness when relationship breaks down. 10) – Making your partner loves you alone. 11) – We create loyalty and everlasting love between couples. 12) – Get a divorce settlement quickly from your ex-partner. 13) – We create everlasting love between couples. 14) – We help you look for the best suitable partner. 15) – We bring back lost lover even if lost for a long time. 16) – We strengthen bonds in all love relationship and marriages 17) – Are you an herbalist who wants to get more powers? 18) – Buy a house or car of your dream. 19) – Unfinished jobs by other doctors come to me. 20) – I help those seeking employment. 21) – Pensioners free treatment. 22) – Win business tenders and contracts. 23) – Do you need to recover your lost property? 24) – Promotion at work and better pay. 25) – Do you want to be protected from bad spirits and nightmares? 26) – Financial problems. 27) – Why you can’t keep money or lovers? 28) – Why you have a lot of enemies? 29) – Why you are fired regularly on jobs? 30) – Speed up money claim spell, delayed payments, pension and accident funds 31) – I help students pass their exams/interviews. 33) – Removal of bad luck and debts. 34) – Are struggling to sleep because of a spiritual wife or husband. 35- ) Recover stolen property
    • OLXTOTO adalah situs bandar togel online resmi terbesar dan terpercaya di Indonesia. Bergabunglah dengan OLXTOTO dan nikmati pengalaman bermain togel yang aman dan terjamin. Koleksi toto 4D dan togel toto terlengkap di OLXTOTO membuat para member memiliki pilihan taruhan yang lebih banyak. Sebagai situs togel terpercaya, OLXTOTO menjaga keamanan dan kenyamanan para membernya dengan sistem keamanan terbaik dan enkripsi data. Transaksi yang cepat, aman, dan terpercaya merupakan jaminan dari OLXTOTO. Nikmati layanan situs toto terbaik dari OLXTOTO dengan tampilan yang user-friendly dan mudah digunakan. Layanan pelanggan tersedia 24/7 untuk membantu para member. Bergabunglah dengan OLXTOTO sekarang untuk merasakan pengalaman bermain togel yang menyenangkan dan menguntungkan.
    • Baba  Serege [[+27-73 590 8989]] has experience of 27 years in helping and guiding many people from all over the world. His psychic abilities may help you answer and resolve many unanswered questions. He specialize in helping women and men from all walks of life.. 1) – Bring back lost lover. even if lost for a long time. 2) – My lover is abusing alcohol, partying and cheating on me I urgently need help” 3) – Divorce or court issues. 4) – Is your love falling apart? 5) – Do you want your love to grow stronger? 6) – Is your partner losing interest in you? 7) – Do you want to catch your partner cheating on you? – We help to keep your partner faithful and loyal to you. 9) – We recover love and happiness when relationship breaks down. 10) – Making your partner loves you alone. 11) – We create loyalty and everlasting love between couples. 12) – Get a divorce settlement quickly from your ex-partner. 13) – We create everlasting love between couples. 14) – We help you look for the best suitable partner. 15) – We bring back lost lover even if lost for a long time. 16) – We strengthen bonds in all love relationship and marriages 17) – Are you an herbalist who wants to get more powers? 18) – Buy a house or car of your dream. 19) – Unfinished jobs by other doctors come to me. 20) – I help those seeking employment. 21) – Pensioners free treatment. 22) – Win business tenders and contracts. 23) – Do you need to recover your lost property? 24) – Promotion at work and better pay. 25) – Do you want to be protected from bad spirits and nightmares? 26) – Financial problems. 27) – Why you can’t keep money or lovers? 28) – Why you have a lot of enemies? 29) – Why you are fired regularly on jobs? 30) – Speed up money claim spell, delayed payments, pension and accident funds 31) – I help students pass their exams/interviews. 33) – Removal of bad luck and debts. 34) – Are struggling to sleep because of a spiritual wife or husband. 35- ) Recover stolen property
  • Topics

×
×
  • Create New...

Important Information

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