mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
The other way leaks memory like a sieve.
This commit is contained in:
parent
f21fbe2d40
commit
030c8e59d7
@ -383,8 +383,11 @@ public final class CombatUtils {
|
||||
int numberOfTargets = Misc.getTier(attacker.getItemInHand()); // The higher the weapon tier, the more targets you hit
|
||||
int damageAmount = Math.max(damage, 1);
|
||||
|
||||
while (numberOfTargets > 0) {
|
||||
for (Entity entity : target.getNearbyEntities(2.5, 2.5, 2.5)) {
|
||||
if (numberOfTargets <= 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (Misc.isNPCEntity(entity) || !(entity instanceof LivingEntity) || !shouldBeAffected(attacker, entity)) {
|
||||
continue;
|
||||
}
|
||||
@ -416,7 +419,6 @@ public final class CombatUtils {
|
||||
numberOfTargets--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void startGainXp(McMMOPlayer mcMMOPlayer, LivingEntity target, SkillType skillType) {
|
||||
startGainXp(mcMMOPlayer, target, skillType, 1.0);
|
||||
|
Loading…
Reference in New Issue
Block a user