EntitySubspaceSpear doesn't check if thrower is a Player
gabizou opened this issue ยท 3 comments
From SpongePowered/SpongeForge#3083:
A user spawned a Herrscher which ends up spawning an EntitySubspaceSpear
by proxy of the EntitySubspace
, and there's a class cast exception that gets spammed:
https://gist.github.com/SSKirillSS/9d5bdae5fa868e6311209d9b642ec759
This looks like a mod bug:
The Herrscher
is spawning an EntitySubSpace
with itself as the thrower
(whose constructor accepts EntityLivingBase
, which during the EntitySubSpace
tick of a type 1
, it'll spawn an EntitySubSpaceSpear
(which again, accepts a similar constructor
) and during the EntitySubspaceSpear
's update, it incorrectly casts the thrower as EntityPlayer
without checking.
This in itself is a mod bug that Sponge has prevented potentially crashing outright on the cast and causing a full server tick crash.
I'd go ahead and submit the bug report to the Extra-Botany repository for the dev to make the simple fix (which it looks like they do have some copy pasted code from here, that correctly checks the thrower is an instance of EntityPlayer
but I'm not an expert of what their logic is attempting to do.