mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2024-12-22 04:37:42 +01:00
Fixed untargeted weapon attacks when casting
This commit is contained in:
parent
ab5926206d
commit
2f5b4eb8cb
@ -10,6 +10,7 @@ import net.Indyuce.mmocore.api.player.attribute.PlayerAttribute;
|
||||
import net.Indyuce.mmocore.api.player.stats.StatType;
|
||||
import net.Indyuce.mmocore.experience.Profession;
|
||||
import net.Indyuce.mmoitems.MMOItems;
|
||||
import net.Indyuce.mmoitems.api.event.item.UntargetedWeaponUseEvent;
|
||||
import net.Indyuce.mmoitems.api.player.RPGPlayer;
|
||||
import net.Indyuce.mmoitems.comp.mmocore.stat.Required_Attribute;
|
||||
import net.Indyuce.mmoitems.comp.mmocore.stat.Required_Profession;
|
||||
@ -62,6 +63,13 @@ public class MMOCoreHook implements RPGHandler, Listener {
|
||||
net.Indyuce.mmoitems.api.player.PlayerData.get(event.getPlayer()).getInventory().scheduleUpdate();
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void stopAttacksWhenCasting(UntargetedWeaponUseEvent event) {
|
||||
PlayerData playerData = PlayerData.get(event.getPlayerData().getUniqueId());
|
||||
if (playerData.isCasting())
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removing this as it is causing issues when players log on for the first time.
|
||||
* Right after MMOCore loads the player data, MMOItems player data is not loaded yet
|
||||
|
Loading…
Reference in New Issue
Block a user