Techguns

Techguns

9M Downloads

Console spam and some Exception

Vitali8 opened this issue ยท 1 comments

commented

Repeat of Techguns #135, to match mod's version, with which problems arise.
I have some spam in the server console. Server console are clogging up with errors, when you somehow interact with a mob (zombie, helicopter) from the mod. I tried to put a spawn on 0 in configs, but this doesn't solve the problem, because in some or other quantities the mobs continue to spawn.

Example error from console: Error

Also, sometimes there is such an Exception: Exception occurred during a PhaseState

commented

The problem stems from here

if (stack.attemptDamageItem(damage, entity.getRNG(), (EntityPlayerMP) entity))

Generally speaking even though that method requires an instance of EntityPlayer as a parameter, it can be safely passed a null as the only thing the instance of EntityPlayer does there is for stat tracking for item damaged.

Alternatively you could do something like this to add it in as required...

if (stack.attemptDamageItem(damage, entity.getRNG(), (entity instanceof EntityPlayerMP ?
 (EntityPlayerMP) entity : null)))