Merge pull request #46 from 369David369/SelfHitFix

Use Entity Id's instead of Player Name for SelfHit
This commit is contained in:
asofold 2018-02-19 11:03:01 +01:00 committed by GitHub
commit f2ba25b51a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,7 +26,8 @@ public class SelfHit extends Check {
}
public boolean check(final Player damager, final Player damaged, final FightData data, final FightConfig cc){
if (!damager.getName().equals(damaged.getName())) return false;
// Check if the Entity Id's are Equals
if (damager.getEntityId() != damaged.getEntityId()) return false;
boolean cancel = false;
// Treat self hitting as instant violation.