Jump to content

Entity Problems


High42Score

Recommended Posts

Hello community,

 

I recently started updating my mod from 1.2.5 (Where everyting was running fine) to 1.3.2. I managed to remove nearly all errors, but a few are left, most of them releated to entities:

 

I have a block, which has to drop an item onDestroyedbyPlayer.

Current Code:

 

public void onBlockDestroyedByPlayer(World world, int i, int j, int k, int l)

    {

        ItemStack itemstack = new ItemStack(mod_Test.SomeNewItemID, 1, 0);

          EntityItem entityitem = new EntityItem(world, i, j, k, itemstack);

   

        if (!world.isRemote)

        {

        world.spawnEntityInWorld(entityitem);

        }

    }

 

The new Item is working. If I change the Item to a feather or something like that, it works.

If I destroy the block, the game crashes with a NullPointerException:

 

2012-09-06 20:35:59 [iNFO] [sTDERR] java.lang.NullPointerException

2012-09-06 20:35:59 [iNFO] [sTDERR] at net.minecraft.src.RenderItem.doRenderItem(RenderItem.java:104)

2012-09-06 20:35:59 [iNFO] [sTDERR] at net.minecraft.src.RenderItem.doRender(RenderItem.java:418)

2012-09-06 20:35:59 [iNFO] [sTDERR] at net.minecraft.src.RenderManager.renderEntityWithPosYaw(RenderManager.java:191)

2012-09-06 20:35:59 [iNFO] [sTDERR] at net.minecraft.src.RenderManager.renderEntity(RenderManager.java:178)

2012-09-06 20:35:59 [iNFO] [sTDERR] at net.minecraft.src.RenderGlobal.renderEntities(RenderGlobal.java:440)

2012-09-06 20:35:59 [iNFO] [sTDERR] at net.minecraft.src.EntityRenderer.renderWorld(EntityRenderer.java:1029)

2012-09-06 20:35:59 [iNFO] [sTDERR] at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:890)

2012-09-06 20:35:59 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:871)

2012-09-06 20:35:59 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:764)

2012-09-06 20:35:59 [iNFO] [sTDERR] at java.lang.Thread.run(Unknown Source)

 

 

And something strange:

I can´t use EntityRegistry.registerModEntity. The game crashes when spawning the mob (or another entity):

 

java.lang.NullPointerException

at cpw.mods.fml.common.network.EntitySpawnPacket.generatePacket(EntitySpawnPacket.java:65)

at cpw.mods.fml.common.network.FMLPacket.makePacket(FMLPacket.java:75)

at cpw.mods.fml.common.network.FMLNetworkHandler.getEntitySpawningPacket(FMLNetworkHandler.java:338)

at net.minecraft.src.EntityTrackerEntry.getPacketForThisEntity(EntityTrackerEntry.java:339)

at net.minecraft.src.EntityTrackerEntry.tryStartWachingThis(EntityTrackerEntry.java:252)

at net.minecraft.src.EntityTrackerEntry.sendEventsToPlayers(EntityTrackerEntry.java:328)

at net.minecraft.src.EntityTracker.addEntityToTracker(EntityTracker.java:156)

at cpw.mods.fml.common.registry.EntityRegistry.tryTrackingEntity(EntityRegistry.java:308)

at net.minecraft.src.EntityTracker.addEntityToTracker(EntityTracker.java:29)

at net.minecraft.src.WorldManager.obtainEntitySkin(WorldManager.java:30)

at net.minecraft.src.World.obtainEntitySkin(World.java:1354)

at net.minecraft.src.WorldServer.obtainEntitySkin(WorldServer.java:748)

at net.minecraft.src.World.spawnEntityInWorld(World.java:1339)

at net.minecraft.src.ItemMonsterPlacer.spawnCreature(ItemMonsterPlacer.java:92)

at net.minecraft.src.ItemMonsterPlacer.tryPlaceIntoWorld(ItemMonsterPlacer.java:57)

at net.minecraft.src.ItemStack.tryPlaceItemIntoWorld(ItemStack.java:115)

at net.minecraft.src.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:358)

at net.minecraft.src.NetServerHandler.handlePlace(NetServerHandler.java:500)

at net.minecraft.src.Packet15Place.processPacket(Packet15Place.java:78)

at net.minecraft.src.MemoryConnection.processReadPackets(MemoryConnection.java:75)

at net.minecraft.src.NetServerHandler.networkTick(NetServerHandler.java:72)

at net.minecraft.src.NetworkListenThread.networkTick(NetworkListenThread.java:55)

at net.minecraft.src.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:132)

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:630)

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:547)

at net.minecraft.src.IntegratedServer.tick(IntegratedServer.java:105)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:453)

at net.minecraft.src.ThreadServerApplication.run(ThreadServerApplication.java:17)

 

registerGlobalEntityID alone works fine. Really strange...

 

I hope you can help me or something like that^^

 

btw: I am using the latest forge build.

Link to comment
Share on other sites

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.



×
×
  • Create New...

Important Information

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