Fixed heroes skill damage being 0

This commit is contained in:
Indyuce 2022-07-07 12:04:40 +02:00
parent 0885263210
commit 4282651210
2 changed files with 7 additions and 5 deletions

View File

@ -49,7 +49,7 @@ public class HeroesHook implements RPGHandler, Listener, AttackHandler {
return null;
Player player = (Player) info.getCharacter().getEntity();
DamageMetadata damageMeta = new DamageMetadata(0, info.getSkill().getTypes().stream().filter(damages::containsKey).map(damages::get).distinct().toArray(DamageType[]::new));
DamageMetadata damageMeta = new DamageMetadata(event.getDamage(), info.getSkill().getTypes().stream().filter(damages::containsKey).map(damages::get).toArray(DamageType[]::new));
return new AttackMetadata(damageMeta, MMOPlayerData.get(player).getStatMap().cache(EquipmentSlot.MAIN_HAND));
}

View File

@ -104,10 +104,12 @@ public abstract class ItemStat {
public abstract void whenClicked(@NotNull EditionInventory inv, @NotNull InventoryClickEvent event);
/**
* When inputing data using chat or anvil input in order to edit the item
* using the GUI editor. IAE are handled and exception messages are sent
* back to the player. Stat edition is not canceled until a right input is
* given or the player inputs 'cancel'
* When inputting data using player input in order to edit the item using
* the GUI editor. IAE's are handled and exception messages are sent back
* to the player. Stat edition is not canceled until a right input is given
* or the player inputs "cancel".
* <p>
* This method is called async inside of an AsyncPlayerChatEvent
*
* @param inv Previously opened edition menu
* @param message Player input