Fix crash with vanilla arrows hitting mobs

Fix crash with vanilla arrows hitting mobs
This commit is contained in:
JAWolfe04 2016-03-22 08:42:19 -05:00
parent 0a00fdaa8f
commit 7962e92298
6 changed files with 60 additions and 52 deletions

View File

@ -1,6 +1,6 @@
minecraft_version=1.7.10
forge_version=10.13.4.1558-1.7.10
tfc_version=0.79.27
mod_version=1.08
mod_version=1.09
mod_id=TerraFirmaPunkTweaks
group_name=com.JAWolfe.TerraFirmaPunkTweaks

View File

@ -1,6 +1,11 @@
Changelog
=================================================
-------------------------------------------------
TFP Tweaks 1.09
-------------------------------------------------
Bug Fix
+Fixed crash from improper casting with mob damage from projectiles
-------------------------------------------------
TFP Tweaks 1.08
-------------------------------------------------
New Features

View File

@ -185,6 +185,8 @@ public class PlayerDamageHandler
else if(event.ammount < 20 && !(event.entity instanceof EntityPlayer) && event.source != null && event.source.getEntity() != null &&
!event.source.getEntity().getClass().getName().contains("bioxx.tfc") && (!event.source.getEntity().getEntityData().hasKey("Attacking") ||
(event.source.getEntity().getEntityData().hasKey("Attacking") && !event.source.getEntity().getEntityData().getBoolean("Attacking"))))
{
if(event.source.getEntity() instanceof EntityLivingBase && ConfigSettings.VanillaMobDamageScaling)
{
EntityLivingBase attacker = (EntityLivingBase)event.source.getEntity();
Entity target = event.entity;
@ -247,6 +249,7 @@ public class PlayerDamageHandler
}
}
}
}
else if(event.source == DamageSource.cactus && event.ammount <=3 && ConfigSettings.VanillaMobDamageScaling)
{
event.entity.attackEntityFrom(event.source, event.ammount * ConfigSettings.VanillaMobDamageMultipier);