Basicly i want to get the name of the map that is played from the "World.class", in a string on my main mod class...
public abstract class World implements IBlockAccess{
protected WorldInfo worldInfo;
//=====OtherStuff=====
public World(ISaveHandler par1ISaveHandler, String par2Str, WorldSettings par3WorldSettings, WorldProvider par4WorldProvider, Profiler par5Profiler, ILogAgent par6ILogAgent)
{
this.worldInfo.setWorldName(par2Str);
}
//=====OtherStuff=====
}
i created a class in the same package with this one
public class World_Spy extends World{
public World_Spy(ISaveHandler par1iSaveHandler, String par2Str,
WorldProvider par3WorldProvider, WorldSettings par4WorldSettings,
Profiler par5Profiler, ILogAgent par6iLogAgent) {
super(par1iSaveHandler, par2Str, par3WorldProvider, par4WorldSettings,
par5Profiler, par6iLogAgent);
}
@Override
protected IChunkProvider createChunkProvider() {
return null;
}
@Override
public Entity getEntityByID(int i) {
return null;
}
String TheName = "";
public void gotIt(){
TheName = this.worldInfo.getWorldName();
System.out.println(TheName);
}
}
and i call it from my main class with:
World_Spy WName = new World_Spy(null, null, null, null, null, null);
but it chrashes on startup... any ideas?