shadowmage45 / AncientWarfare

Updated Ancient Warfare mod for Minecraft 1.5.2+
http://ancientwarfare.wikispaces.com/
Other
10 stars 8 forks source link

NPE - in getAmountHealed method #60

Closed TechStack closed 10 years ago

TechStack commented 10 years ago

Hey shadow i've had this crash on the server 4 times in the last two days. In every case its a NPE in the getAmountHealed method. Unfortunately i do not have a lot more details on how to reproduce.. been working very late days. I wanted to give you a heads up on the issue so your aware :)

---- Minecraft Crash Report ---- // Surprise! Haha. Well, this is awkward.

Time: 4/3/14 3:54 PM Description: Ticking entity

java.lang.NullPointerException at shadowmage.ancient_warfare.common.npcs.NpcBase.getAmountHealed(NpcBase.java:328) at shadowmage.ancient_warfare.common.npcs.ai.tasks.AIHealTarget.onTick(AIHealTarget.java:53) at shadowmage.ancient_warfare.common.npcs.ai.NpcAIObjective.onTick(NpcAIObjective.java:100) at shadowmage.ancient_warfare.common.npcs.NpcAIObjectiveManager.updateObjectives(NpcAIObjectiveManager.java:79) at shadowmage.ancient_warfare.common.npcs.NpcBase.func_70629_bd(NpcBase.java:517) at net.minecraft.entity.EntityLiving.func_70619_bc(EntityLiving.java:619) at net.minecraft.entity.EntityLivingBase.func_70636_d(EntityLivingBase.java:1993) at net.minecraft.entity.EntityLiving.func_70636_d(EntityLiving.java:441) at shadowmage.ancient_warfare.common.npcs.NpcBase.func_70636_d(NpcBase.java:680) at net.minecraft.entity.EntityLivingBase.func_70071h(EntityLivingBase.java:1826) at net.minecraft.entity.EntityLiving.func_70071h(EntityLiving.java:257) at shadowmage.ancient_warfare.common.npcs.NpcBase.func_70071h(NpcBase.java:792) at net.minecraft.world.World.func_72866_a(World.java:2350) at net.minecraft.world.WorldServer.func_72866_a(WorldServer.java:719) at net.minecraft.world.World.func_72870_g(World.java:2311) at net.minecraft.world.World.func_72939_s(World.java:2157) at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:550) at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:668) at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:276) at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:587) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:484) at net.minecraft.server.ThreadMinecraftServer.run(SourceFile:583)

A detailed walkthrough of the error, its code path and all known details is as follows:

-- Head -- Stacktrace: at shadowmage.ancient_warfare.common.npcs.NpcBase.getAmountHealed(NpcBase.java:328) at shadowmage.ancient_warfare.common.npcs.ai.tasks.AIHealTarget.onTick(AIHealTarget.java:53) at shadowmage.ancient_warfare.common.npcs.ai.NpcAIObjective.onTick(NpcAIObjective.java:100) at shadowmage.ancient_warfare.common.npcs.NpcAIObjectiveManager.updateObjectives(NpcAIObjectiveManager.java:79) at shadowmage.ancient_warfare.common.npcs.NpcBase.func_70629_bd(NpcBase.java:517) at net.minecraft.entity.EntityLiving.func_70619_bc(EntityLiving.java:619) at net.minecraft.entity.EntityLivingBase.func_70636_d(EntityLivingBase.java:1993) at net.minecraft.entity.EntityLiving.func_70636_d(EntityLiving.java:441) at shadowmage.ancient_warfare.common.npcs.NpcBase.func_70636_d(NpcBase.java:680) at net.minecraft.entity.EntityLivingBase.func_70071h(EntityLivingBase.java:1826) at net.minecraft.entity.EntityLiving.func_70071h(EntityLiving.java:257) at shadowmage.ancient_warfare.common.npcs.NpcBase.func_70071h(NpcBase.java:792) at net.minecraft.world.World.func_72866_a(World.java:2350) at net.minecraft.world.WorldServer.func_72866_a(WorldServer.java:719) at net.minecraft.world.World.func_72870_g(World.java:2311)

-- Entity being ticked -- Details: Entity Type: AncientWarfare.entity.npc (shadowmage.ancient_warfare.common.npcs.NpcBase) Entity ID: 885757 Entity Name: entity.AncientWarfare.entity.npc.name Entity's Exact location: 2681.53, 68.00, 7727.81 Entity's Block location: World: (2681,68,7727), Chunk: (at 9,4,15 in 167,482; contains blocks 2672,0,7712 to 2687,255,7727), Region: (5,15; contains chunks 160,480 to 191,511, blocks 2560,0,7680 to 3071,255,8191) Entity's Momentum: 0.00, -0.08, 0.00 Stacktrace: at net.minecraft.world.World.func_72939_s(World.java:2157) at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:550)

-- Affected level -- Details: Level name: world All players: 2 total; [EntityPlayerMP['Lazsa'/189, l='world', x=-802.79, y=64.00, z=840.84], EntityPlayerMP['gtrain2346'/885499, l='world', x=2628.10, y=91.00, z=7680.04]] Chunk stats: ServerChunkCache: 2592 Drop: 0 Level seed: -4299573909803839831 Level generator: ID 00 - default, ver 1. Features enabled: true Level generator options: Level spawn location: World: (-1057,64,2713), Chunk: (at 15,4,9 in -67,169; contains blocks -1072,0,2704 to -1057,255,2719), Region: (-3,5; contains chunks -96,160 to -65,191, blocks -1536,0,2560 to -1025,255,3071) Level time: 213711532 game time, 134253567 day time Level dimension: 0 Level storage version: 0x04ABD - Anvil Level weather: Rain time: 9657 (now: false), thunder time: 79400 (now: false) Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: false Stacktrace: at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:668) at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:276) at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:587) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:484) at net.minecraft.server.ThreadMinecraftServer.run(SourceFile:583)

-- System Details -- Details: Minecraft Version: 1.6.4 Operating System: Linux (amd64) version 2.6.32-358.el6.x86_64 Java Version: 1.7.0_45, Oracle Corporation Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 2972068528 bytes (2834 MB) / 6392119296 bytes (6096 MB) up to 6392119296 bytes (6096 MB) JVM Flags: 4 total; -Xms6096M -Xmx6096M -XX:ParallelGCThreads=4 -XX:+UseG1GC AABB Pool Size: 12712 (711872 bytes; 0 MB) allocated, 11227 (628712 bytes; 0 MB) used Suspicious classes: FML and Forge are installed IntCache: cache: 0, tcache: 0, allocated: 1, tallocated: 63 FML: MCP v8.11 FML v6.4.49.965 Minecraft Forge 9.11.1.965 14 mods loaded, 14 mods active mcp{8.09} Minecraft Coder Pack Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available FML{6.4.49.965} Forge Mod Loader Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Forge{9.11.1.965} Minecraft Forge Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available CodeChickenCore{0.9.0.7} CodeChicken Core Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Evoc{1.0.0} Evoc Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available MobiusCore{1.0.4} MobiusCore Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available NotEnoughItems{1.6.1.8} [Not Enough Items](NotEnoughItems 1.6.1.8.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available AncientWarfare{1.1.043-beta-MC164} Ancient Warfare Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available ForgePerms{1.6.1.7} ForgePerms Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available PermissionsEx{1.5.0.0} PermissionsEx Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Morpheus{1.2} Morpheus Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available MyTown{1.6.1.16} MyTown Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available MapWriter{2.0.1} MapWriter Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Opis{1.1.2_alpha} Opis Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Profiler Position: N/A (disabled) Vec3 Pool Size: 9760 (546560 bytes; 0 MB) allocated, 7496 (419776 bytes; 0 MB) used Player Count: 2 / 50; [EntityPlayerMP['Lazsa'/189, l='world', x=-802.79, y=64.00, z=840.84], EntityPlayerMP['gtrain2346'/885499, l='world', x=2628.10, y=91.00, z=7680.04]] Is Modded: Definitely; Server brand changed to 'fml,forge' Type: Dedicated Server (map_server.txt)

shadowmage45 commented 10 years ago

Thanks for the report. I will look into this shortly, and should have a fix available with the next update

shadowmage45 commented 10 years ago

As near as I can tell, this is happening because of a corrupted NPC. Somehow the NPC is not loading up the proper internal values, and trying to access either a not-present or too-short of a data table when trying to look up the healing value.

I've put some null-checks in place and set a default return value. This should fix the crashes, however, it does not solve the underlying issue of whatever is corrupting the NPCs. I'll see about putting some useful error/logging in that section, to at least log what the offending NPC is...try and get some idea on where to start looking for the cause.

(Honestly though, I may just leave it with the hack/fix in place, as the 1.7 system should resolve these issues)

shadowmage45 commented 10 years ago

This should be fixed in the latest test-releases. Hopefully I'll get those to be 'public' releases sometime this week, so you can get the fix in-place on your server finally.

Closing for now -- please re-open if you find this is not fixed in the latest releases.