Zedly / Zenchantments

More enchantments without mods or resource packs. CB/Spigot 1.14.4 / 1.12 / 1.11.x / 1.10.x
GNU General Public License v3.0
12 stars 23 forks source link

Weight spams console (Duplicate of #36) #46

Closed Geolykt closed 4 years ago

Geolykt commented 4 years ago

I might be wrong, but looking at the code it shouldn't be fixed:

public boolean onBeingHit(EntityDamageByEntityEvent evt, int level, boolean usedHand) {
    if (!(evt.getEntity() instanceof LivingEntity) ||
        !ADAPTER.attackEntity((LivingEntity) evt.getEntity(), (Player) evt.getDamager(), 0)) {
        return true;
    }
}

We have already established that evt.getEntity() is not of instance of LivingEntity, so why cast it into a LivingEntity? The same goes for evt.getDamager(). I assume evt.getDamager() and evt.getEntity() were mixed up?

Originally posted by @Geolykt in https://github.com/Zedly/Zenchantments/issues/36#issuecomment-655750115

Zedly commented 4 years ago

Please see the other thread and verify the issue has been resolved!

Geolykt commented 4 years ago

Proven to have been fixed in 1.16