Jump to content

Recommended Posts

Posted

Hi all,

I'm getting a crash ever-so-often, for which the log says: "Skipping Entity with id 0".

 

Full log:

2012-09-01 16:28:22 [iNFO] [sTDOUT] Skipping Entity with id 0
2012-09-01 16:28:23 [iNFO] [sTDERR] java.lang.NullPointerException
2012-09-01 16:28:23 [iNFO] [sTDERR] 	at net.minecraft.src.NetClientHandler.handleMobSpawn(NetClientHandler.java:743)
2012-09-01 16:28:23 [iNFO] [sTDERR] 	at net.minecraft.src.Packet24MobSpawn.processPacket(Packet24MobSpawn.java:139)
2012-09-01 16:28:23 [iNFO] [sTDERR] 	at net.minecraft.src.MemoryConnection.processReadPackets(MemoryConnection.java:75)
2012-09-01 16:28:23 [iNFO] [sTDERR] 	at net.minecraft.src.NetClientHandler.processReadPackets(NetClientHandler.java:101)
2012-09-01 16:28:23 [iNFO] [sTDERR] 	at net.minecraft.src.WorldClient.tick(WorldClient.java:66)
2012-09-01 16:28:23 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.runTick(Minecraft.java:1777)
2012-09-01 16:28:23 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:834)
2012-09-01 16:28:23 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.run(Minecraft.java:764)
2012-09-01 16:28:23 [iNFO] [sTDERR] 	at java.lang.Thread.run(Thread.java:662)     //~~ I forcibly close the game here, as it appears blackscreened&/frozen (waiting a while for minecraft to show it's own log in the gui shows nothing different)
2012-09-01 16:28:24 [iNFO] [sTDERR] Someone is closing me!
AL lib: ALc.c:1352: exit(): closing 1 Device
AL lib: ALc.c:1329: alcCloseDevice(): destroying 1 Context
AL lib: alSource.c:2361: alcDestroyContext(): deleting 32 Source(s)
AL lib: alBuffer.c:1081: exit(): deleting 15 Buffer(s)

 

I'm using Forge build 243, FML version 3.0.171.348 - it's been happening for a few versions now. I'm assuming it's something to do with my entity spawning?

My spawn code:

 

private void addSpawns()
{
       //mobs is an array of my entity classes, spawnrate is an integer variable (5).
        for(Class mob: mobs)
{
	addFriendly(mob, spawnrate, 1, 1);
}

        //more spawns in a similar fashion, snipped here.
}

private void addFriendly(Class<? extends EntityLiving> mob, int rarity, int lowestgroup, int largestgroup)
{
EntityRegistry.addSpawn(mob, rarity, lowestgroup, largestgroup, EnumCreatureType.creature, WorldType.base12Biomes);
}

 

derp, forgot half the code:

private void registerEntities()
{
        addMobLocale("TimberWolf", "Timber Wolf");
        EntityRegistry.registerGlobalEntityID(EntityTimberWolf.class, "TimberWolf", ModLoader.getUniqueEntityId(), Color.ORANGE.hashCode(), Color.GRAY.hashCode());
}
        
private void addMobLocale(String name, String secondname)
{
name = name.replaceAll(" ", "");
LanguageRegistry.instance().addStringLocalization("entity."+name+".name", "en_US", secondname);
}

 

I've no idea if it's relevant, but mob spawning is ridiculously/tediously sparse in comparison to ModLoader's spawning - yet I'm using the same values.

 

Thanks,

~T.

Posted

Also register your entity with:

 

EntityRegistry.registerModEntity()

 

See if that helps. I also have a few odd entity behaviors I cannot quite figure out that might be tied to the use of worldObj or !this.worldObj.isRemote not sure though. Anyway I hope this helps. :)

Posted

Yeah, I'm still having the issue. Changing the order of things has done nothing.

 

2012-09-08 23:40:18 [iNFO] [sTDOUT] Skipping Entity with id 0
2012-09-08 23:40:19 [iNFO] [sTDERR] java.lang.NullPointerException
2012-09-08 23:40:19 [iNFO] [sTDERR] 	at net.minecraft.src.NetClientHandler.handleMobSpawn(NetClientHandler.java:743)
2012-09-08 23:40:19 [iNFO] [sTDERR] 	at net.minecraft.src.Packet24MobSpawn.processPacket(Packet24MobSpawn.java:139)
2012-09-08 23:40:19 [iNFO] [sTDERR] 	at net.minecraft.src.MemoryConnection.processReadPackets(MemoryConnection.java:75)
2012-09-08 23:40:19 [iNFO] [sTDERR] 	at net.minecraft.src.NetClientHandler.processReadPackets(NetClientHandler.java:101)
2012-09-08 23:40:19 [iNFO] [sTDERR] 	at net.minecraft.src.WorldClient.tick(WorldClient.java:66)
2012-09-08 23:40:19 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.runTick(Minecraft.java:1777)
2012-09-08 23:40:19 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:834)
2012-09-08 23:40:19 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.run(Minecraft.java:764)
2012-09-08 23:40:19 [iNFO] [sTDERR] 	at java.lang.Thread.run(Thread.java:662)

Posted

I moved registerModEntity after registerglobalid. It still crashes.

Updated forge to 1.4, still crashes. What am I doing wrong?

 

It's still happening. Full log from starting to crashing:

 

  Reveal hidden contents

 

 

FML Log:

 

  Reveal hidden contents

 

 

EDIT:

 

Fixed - the issue was me being a complete noob, and forgetting to register a certain entity.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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