Improved performance of custom projectiles

This commit is contained in:
Jules 2024-06-21 19:44:08 -07:00
parent c71f673bc4
commit 600a53f931
2 changed files with 2 additions and 2 deletions

View File

@ -244,7 +244,7 @@ public class ItemUse implements Listener {
// Have to get hand manually because 1.15 and below does not have event.getHand()
final ItemStack itemInMainHand = playerData.getPlayer().getInventory().getItemInMainHand();
final EquipmentSlot bowSlot = itemInMainHand.isSimilar(event.getBow()) ? EquipmentSlot.MAIN_HAND : EquipmentSlot.OFF_HAND;
final ProjectileMetadata proj = ProjectileMetadata.create(playerData.getStats().newTemporary(bowSlot), ProjectileType.ARROW, event.getProjectile());
final ProjectileMetadata proj = ProjectileMetadata.create(playerData.getMMOPlayerData(), bowSlot, ProjectileType.ARROW, event.getProjectile());
proj.setSourceItem(item);
proj.setCustomDamage(true);
proj.setDamageMultiplier(event.getForce());

View File

@ -132,7 +132,7 @@ public class PlayerListener implements Listener {
return;
}
final ProjectileMetadata proj = ProjectileMetadata.create(playerData.getStats().newTemporary(EquipmentSlot.fromBukkit(item.getSlot())), ProjectileType.TRIDENT, event.getEntity());
final ProjectileMetadata proj = ProjectileMetadata.create(playerData.getMMOPlayerData(), EquipmentSlot.fromBukkit(item.getSlot()), ProjectileType.TRIDENT, event.getEntity());
proj.setSourceItem(nbtItem);
proj.setCustomDamage(true);
}