mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2024-12-22 04:37:42 +01:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
58e6e61ad8
2
pom.xml
2
pom.xml
@ -160,7 +160,7 @@
|
||||
<dependency>
|
||||
<groupId>io.lumine</groupId>
|
||||
<artifactId>MythicLib-dist</artifactId>
|
||||
<version>1.4</version>
|
||||
<version>1.3.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
@ -10,7 +10,6 @@ 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;
|
||||
@ -63,13 +62,6 @@ 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
|
||||
|
@ -95,11 +95,10 @@ public class ItemUse implements Listener {
|
||||
useItem.executeCommands();
|
||||
}
|
||||
|
||||
// Target free weapon attack
|
||||
if (useItem instanceof UntargetedWeapon) {
|
||||
|
||||
UntargetedWeapon weapon = (UntargetedWeapon) useItem;
|
||||
if ((event.getAction().name().contains("RIGHT_CLICK") && weapon.getWeaponType() == UntargetedWeaponType.RIGHT_CLICK)
|
||||
|| (event.getAction().name().contains("LEFT_CLICK") && weapon.getWeaponType() == UntargetedWeaponType.LEFT_CLICK))
|
||||
if (weapon.getWeaponType().corresponds(event.getAction()))
|
||||
weapon.handleTargetFreeAttack(EquipmentSlot.fromBukkit(event.getHand()));
|
||||
}
|
||||
}
|
||||
|
@ -63,6 +63,9 @@ public class PlayerListener implements Listener {
|
||||
// No
|
||||
if (event instanceof Cancellable) { if (((Cancellable) event).isCancelled()) { return; } }
|
||||
|
||||
// Supports NPCs
|
||||
if (!PlayerData.has(event.getEntity())) return;
|
||||
|
||||
// Get Player
|
||||
PlayerData data = PlayerData.get(event.getEntity());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user