Skip to content

Commit

Permalink
Fix incorrect instanceof call for jumping
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Jun 12, 2021
1 parent 8d17d85 commit 6304842
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,8 @@ public void attack(org.bukkit.entity.LivingEntity attacker, org.bukkit.entity.Li
float f = (float) (attackDamage == null ? 1 : attackDamage.getValue());
int i = 0;

if (target instanceof LivingEntity) {
f += EnchantmentHelper.getDamageBonus(handle.getMainHandItem(), target.getMobType());
i += EnchantmentHelper.getKnockbackBonus(handle);
}
f += EnchantmentHelper.getDamageBonus(handle.getMainHandItem(), target.getMobType());
i += EnchantmentHelper.getKnockbackBonus(handle);

boolean flag = target.hurt(DamageSource.mobAttack(handle), f);

Expand Down Expand Up @@ -1273,7 +1271,7 @@ public void setWitherCharged(Wither wither, boolean charged) {

@Override
public boolean shouldJump(org.bukkit.entity.Entity entity) {
if (JUMP_FIELD == null || !(entity instanceof LivingEntity))
if (JUMP_FIELD == null || !(entity instanceof org.bukkit.entity.LivingEntity))
return false;
try {
return (boolean) JUMP_FIELD.invoke(NMSImpl.getHandle(entity));
Expand Down

0 comments on commit 6304842

Please sign in to comment.