-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.15.1 cannot be cast to entity player warning #36
Comments
This error is now fixed! |
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 |
Hi, should I have mentioned that the fix is on the dev branch? Sorry if this caused confusion. The offending code was removed in 4b51a7d. Thanks for keeping me informed! |
I'm a bit confused since I swear that this commit was pushed just a few hours ago. Anyways, I will try to reproduce it (once I am able to set up a 1.16.2 testing environment) and then make an update statement. |
Checked, and the issue (on the dev branch) should still occour. However, this test has been done logically, and not in a bukkit environment, which is quite different |
The typecast in onBeingHit is safe because the type is checked in WatcherEnchant.java:154. I will change the type of the parameter in onBeingHit to Player, though. |
Nevermind that's not how the code works. It's been a while since I looked at it |
I know you dont have a 1.15 version out yet but uh after updating to 1.15 I started getting this warning in console when people hit mobs with custom enchants.
Pastebin
The text was updated successfully, but these errors were encountered: