mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-01-21 09:21:21 +01:00
Improved performance of custom projectiles
This commit is contained in:
parent
c71f673bc4
commit
600a53f931
@ -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());
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user