mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 03:39:17 +00:00
Added a null check to the Thorn Chakram to prevent it from crashing if the entity that threw it is unloaded. Closes #1944
This commit is contained in:
1 parent
ee96f3366d
commit
f684ebc80d
1 file changed
+7
-5
@@ -81,11 +81,13 @@ public class EntityThornChakram extends EntityThrowable {
|
||||
|
||||
// Returning motion
|
||||
if(isReturning()) {
|
||||
Entity thrower = worldObj.getEntityByID(getEntityToReturnTo());
|
||||
Vector3 motion = Vector3.fromEntityCenter(thrower).subtract(Vector3.fromEntityCenter(this)).normalize();
|
||||
motionX = motion.x;
|
||||
motionY = motion.y;
|
||||
motionZ = motion.z;
|
||||
Entity thrower = getThrower();
|
||||
if(thrower != null) {
|
||||
Vector3 motion = Vector3.fromEntityCenter(thrower).subtract(Vector3.fromEntityCenter(this)).normalize();
|
||||
motionX = motion.x;
|
||||
motionY = motion.y;
|
||||
motionZ = motion.z;
|
||||
}
|
||||
}
|
||||
|
||||
// Client FX
|
||||
|
||||
Reference in new issue
Block a user