Tough As Nails

Tough As Nails

21M Downloads

[Bug Report] Game Crash

Baylem opened this issue ยท 2 comments

commented

Hello. I have found an issue revolving around the Iceball which is fired from the Freeze entity.

Here is the needed information from my log:

Mod Version: 1.0.11 and 1.11

Time: 5/21/17 8:02 PM
Description: Ticking entity

java.lang.NullPointerException: Ticking entity
at toughasnails.core.ClientProxy.spawnParticle(ClientProxy.java:93)
at toughasnails.entities.projectile.EntityIceball.func_70071_h_(EntityIceball.java:223)

-- Entity being ticked --
Details:
Entity Type: ToughAsNails.iceball (toughasnails.entities.projectile.EntityIceball)
Entity ID: 392
Entity Name: entity.ToughAsNails.iceball.name

The particular line of code from Iceball.java is line 233 with the code
https://github.com/Glitchfiend/ToughAsNails/blob/TAN-1.11.x-2.0.0/src/main/java/toughasnails/entities/projectile/EntityIceball.java#L223

ToughAsNails.proxy.spawnParticle(TANParticleTypes.SNOWFLAKE, this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]);

The other listed error is in the method itself at:
https://github.com/Glitchfiend/ToughAsNails/blob/TAN-1.11.x-2.0.0/src/main/java/toughasnails/core/ClientProxy.java#L93

entityFx = new EntitySnowflakeFX(minecraft.world, x, y, z, MathHelper.nextDouble(minecraft.world.rand, -0.03, 0.03), -0.02D, MathHelper.nextDouble(minecraft.world.rand, -0.03, 0.03));

To recreate this game crash:

  1. You need to spawn in a Freeze
  2. Let the freeze fire at you but pause the game before the Iceball hits you (does not need to be on a colliding path with the player)
  3. Leave the world
  4. Attempt to rejoin the world.
commented

I could reproduce this.
2. the Iceball does not need to be on a collision course with the player.

world == null

Starting my IDE as we speak.

commented

Can be fixed by adding World parWorld to the parameters of CommonProxy#spawnParticle.
In ClientProxy#spawnParticle, each mention of minecraft.world should be replaced by world.
EntityIceball and EntityFreeze can both pass this.world as a parameter. BlockTANTemperatureCoil#randomDisplayTick has a World world parameter that can be passed on.