Hey,
Im making a game with slick and lwjgl only I’ve got this error:
[quote]Exception in thread “main” java.lang.NullPointerException
at Lost.Adventure.WorldGenBasic.build(WorldGenBasic.java:198)
at Lost.Adventure.Mainclass.start(Mainclass.java:45)
at Lost.Adventure.Mainclass.main(Mainclass.java:78)
[/quote]
From this piece of code:
stone.bind();
This is how I load the textures:
static Texture stone;
static Texture dirt;
static Texture grass;
static Texture log;
static Texture leaves;
public void init() throws IOException
{
try {
stone = TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("blocks/stone.png"));
dirt = TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("blocks/dirt.png"));
grass = TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("blocks/grass.png"));
log = TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("blocks/log.png"));
leaves = TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("blocks/leaves.png"));
} catch (IOException e) {
e.printStackTrace();
}
}
And this is my workspace:
Project -> scr -> Lost.adventure -> WorldGenBasic.java (java files)
Project -> blocks -> stone.png (resources)
How does I fix this error?
Thank you in advance!