Memory leak fix for arrow metadata

This commit is contained in:
nossr50
2021-01-05 12:04:48 -08:00
parent 7ea6809fd3
commit 888205fd89
5 changed files with 70 additions and 26 deletions

View File

@ -55,8 +55,7 @@ public class ArcheryManager extends SkillManager {
public double distanceXpBonusMultiplier(LivingEntity target, Entity arrow) {
//Hacky Fix - some plugins spawn arrows and assign them to players after the ProjectileLaunchEvent fires
if(!arrow.hasMetadata(mcMMO.arrowDistanceKey))
return arrow.getLocation().distance(target.getLocation());
return 1;
Location firedLocation = (Location) arrow.getMetadata(mcMMO.arrowDistanceKey).get(0).value();
Location targetLocation = target.getLocation();