Jump to content

Recommended Posts

Posted

I have a bug with the actual Minecraft Forge 4.0.0 build 200: I've rewrote my mod to the new forge build. However, spawning entities, rendering, interacting and such does work properly now for me. The only thing I have problems with is, that when I kill one of my entities, the game crashes sometimes (not everytime when I kill these) with this error:

 

  Reveal hidden contents

 

 

Here's the FML client log file:

 

  Reveal hidden contents

 

 

If I kill the same entities on a server, it doesn't happen, neither on the client nor on the server. On client-only, it's the same error and I dunno what's causing it.

 

Here's my mod_ file, if anybody needs it:

https://gist.github.com/4e3d7b2b13bb339601b7

 

BTW: My entity type implements IAnimal and uses currently the attackEntityFrom(...) method from the superclass (EntityCreature). Instead of this, there's no method in my entity class, which will be called on hit / death.

 

Some more infos:

  • Minecraft ver. 1.3.2 (final)
  • Minecraft Server ver. 1.3.2 (final)
  • MCP v.7.2

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

  Quote

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.

Posted

I need to see your entity class, and anything that calls world.getEntitiesWithinAABBExcludingEntity if you do.

 

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted
  On 8/17/2012 at 1:22 PM, LexManos said:

I need to see your entity class, and anything that calls world.getEntitiesWithinAABBExcludingEntity if you do.

 

Here ya go:

https://gist.github.com/f876fb64b62074d7791c

 

it is HUGE and it's messy (I've cleaned that up since I overtook the mod from KodaichiZero a bit). There are 3 lines where I called worldObj.getEntitiesWithinAABBExcludingEntity at line 643, 1210 and 1627. Even when I outcomment the code which uses this method and it crashes anyway.

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

  Quote

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.

Posted
  On 8/17/2012 at 1:35 PM, SanAndreasP said:

  Quote

I need to see your entity class, and anything that calls world.getEntitiesWithinAABBExcludingEntity if you do.

 

Here ya go:

https://gist.github.com/f876fb64b62074d7791c

 

it is HUGE and it's messy (I've cleaned that up since I overtook the mod from KodaichiZero a bit). There are 3 lines where I called worldObj.getEntitiesWithinAABBExcludingEntity at line 643, 1210 and 1627. Even when I outcomment the code which uses this method and it crashes anyway.

 

Remember, everything is called twice (server and client)

check if it's called in client world and don't execute the code in this method:

 

on top of the code:

if(world.isRemote){
return;
}

Posted
  On 8/17/2012 at 1:41 PM, pitman-87 said:

  Quote

  Quote

I need to see your entity class, and anything that calls world.getEntitiesWithinAABBExcludingEntity if you do.

 

Here ya go:

https://gist.github.com/f876fb64b62074d7791c

 

it is HUGE and it's messy (I've cleaned that up since I overtook the mod from KodaichiZero a bit). There are 3 lines where I called worldObj.getEntitiesWithinAABBExcludingEntity at line 643, 1210 and 1627. Even when I outcomment the code which uses this method and it crashes anyway.

 

Remember, everything is called twice (server and client)

check if it's called in client world and don't execute the code in this method:

 

on top of the code:

if(world.isRemote){
return;
}

 

Well, it has nothing to do with the list stuff, nor with code which are called twice. I checked my code again and found the crash maker. It's this:

 

if(FMLCommonHandler.instance().getSide().equals(Side.CLIENT))
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new EntityDiggingFX(worldObj, a, b, c, 0.0D, 0.0D, 0.0D, Block.cloth, 0, teamCloth(getClayTeam())));

 

on line 2669 in the method attackEntityFrom();

 

Is there a similar way to spawn custom particles?

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

  Quote

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.

Posted

Sorry for DP, but I played around and did some code-fixing in my mod and I can clearly confirm it is the method

FMLClientHandler.instance().getClient().effectRenderer.addEffect( [new entityFX instance] );

 

I tried also following:

Minecraft.getMinecraft().effectRenderer.addEffect( [new entityFX instance] );

 

With or without checking if it's client-sided or not. I get often (not everytime) the error in the OP. If it doesn't crash I can see the particles properly.

 

If I use this instead:

this.worldObj.spawnParticle("reddust", a, b, c, 0.0D, 0.0D, 0.0D);

 

it doesn't crash but it doesn't show any particles either.

 

 

Also I tried this whole thing on a dedicated server.

It doesn't crash in any case with any method, but it doesn't show me particles either.

 

So did I do something wrong or is this a bug?

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

  Quote

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.

Posted

just a heads up, you'll need to change the package that your mod file is in, as of build 204 FML with crash if there are any files in the net.minecraft.src or a sub-package of it

Posted
  On 8/18/2012 at 10:21 PM, Viper283 said:

just a heads up, you'll need to change the package that your mod file is in, as of build 204 FML with crash if there are any files in the net.minecraft.src or a sub-package of it

 

I did that already (FML spammed me because of that). Package is now SanAndreasP.mods.ClaySoldierMod, but that didn't solve my problem. I still get the same error. :/

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

  Quote

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.

Posted

at net.minecraft.src.World.getCollidingBoundingBoxes(World.java:1466)

You'll see a collection on this line, that is being itterated over.

Somewhere inside of that loop, you are modifying the thing that's being itterated over.

You're gunna have to figure out what your in code is called, that edit that collection.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted
  On 8/19/2012 at 1:48 AM, LexManos said:

at net.minecraft.src.World.getCollidingBoundingBoxes(World.java:1466)

You'll see a collection on this line, that is being itterated over.

Somewhere inside of that loop, you are modifying the thing that's being itterated over.

You're gunna have to figure out what your in code is called, that edit that collection.

 

If it would be so easy :/

I've tried everything now...

- outcomment all code with "boundingBox" and "axisalignedbb" doesn't work

- outcomment all overridden methods (such as onUpdate() aso.) except attackEntityFrom(...), which now spawns only the particles and returns super.attackEntityFrom(...) (the rest inside it is outcommented)

- create a completely new entity, which spawns continously particles and isn't related to anything in my mod (except the spawn item)

 

It crashes with the same error.

 

- using the worldObj.spawnParticle(...) in the new entity, which doesn't crash, but doesn't spawn anything either.

 

Has this something to do with the worldObj field? Because both particle spawn things uses it. This is the spawning item code, if it's necessary:

https://gist.github.com/9088b8e72638205dd129

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

  Quote

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.

Posted

Okay, I think I solved the problem now. As I thought it was the worldObj field from the entity I've used. I'm using now Minecraft.getMinecraft().theWorld instead and no crash so far.

Here's the code which I'm using to spawn custom digging particles now:

 

if(FMLCommonHandler.instance().getSide().isClient())
    Minecraft.getMinecraft().effectRenderer.addEffect( new EntityDiggingFX(Minecraft.getMinecraft().theWorld /* use this instead of this.worldObj */, X, Y, Z, 0.0D, 0.0D, 0.0D, Block.cloth, 0, teamCloth(getDataWatcherShort("clayTeam"))));

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

  Quote

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.

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.