MyPet Error
Sikatsu opened this issue ยท 12 comments
I think this has been following us around for years.
Why do you think it is the same bug??? :-) all java bugs look like the same ;-)
Anyway, do you know what trigger this bug? Im able to see mypet is involved...
No idea, but I mean MyPet errors in general have been here for years. I have no idea, it just shows up in my console frequently.
Could it be that killer is null when Entity dies from fall damage?
By the way a cleanup would help here. Reducing the method length from around 1.200 lines to a maximum of 100 lines.
Its a good idea. I will check what happens if the pet dies while the killer is null.
Do you have away to reduce the code by 90%? :-)
Do you have away to reduce the code by 90%? :-)
Split it up and reduce the complexity.
I have actually reworked the code more than 5 times over the years.
The code is very complex because it integrates to many other plugins. I could probably spilt ud the code, but in the end it would not reduce the total number of lines... i think ...
But it will reduce lines per method and lines per class. Complexity will be reduced.
- Single Responsible Principle
- Open Closed Principle
- Liskov Substitution Principle
- Interface Segregation Principle
- Dependency Inversion Principle
https://hackernoon.com/solid-principles-made-easy-67b1246bcdf
I dont think killed can be null
This is how killed is created
private void onMobDeath(EntityDeathEvent event) {
LivingEntity killed = event.getEntity();
Looking at the error text, it looks like a MyPet attacked a zombie and then the zombie was killed by fire (daylight) ???? but I dont know how to reproduce / verify that
I dont think killed can be null
This is how killed is created
private void onMobDeath(EntityDeathEvent event) { LivingEntity killed = event.getEntity();
Looking at the error text, it looks like a MyPet attacked a zombie and then the zombie was killed by fire (daylight) ???? but I dont know how to reproduce / verify that
I said Killer is null. Not killed. Killer != killed.
killed -> victim dying
Killer -> the entity that kills the victim
check if killed.getKiller() is null
killed.getKiller() is null if the killer is not a Player... so that is not a solution.
@Sikatsu do you still see this error?
If yes, could you please provide me with a fresh error text?