mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-01-03 06:37:47 +01:00
Cleanup
This commit is contained in:
parent
69f9c89959
commit
1339af2604
@ -1,6 +1,7 @@
|
|||||||
package net.Indyuce.mmoitems.api.interaction.weapon.untargeted;
|
package net.Indyuce.mmoitems.api.interaction.weapon.untargeted;
|
||||||
|
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to determine if the item must be left or right clicked in order to
|
* Used to determine if the item must be left or right clicked in order to
|
||||||
@ -13,8 +14,9 @@ public enum UntargetedWeaponType {
|
|||||||
RIGHT_CLICK,
|
RIGHT_CLICK,
|
||||||
LEFT_CLICK;
|
LEFT_CLICK;
|
||||||
|
|
||||||
public boolean corresponds(Action action) {
|
public boolean corresponds(@NotNull Action action) {
|
||||||
return (this == RIGHT_CLICK && (action == Action.RIGHT_CLICK_AIR || action == Action.RIGHT_CLICK_BLOCK))
|
return this == RIGHT_CLICK ?
|
||||||
|| (this == LEFT_CLICK && (action == Action.LEFT_CLICK_AIR || action == Action.LEFT_CLICK_BLOCK));
|
action == Action.RIGHT_CLICK_AIR || action == Action.RIGHT_CLICK_BLOCK :
|
||||||
|
action == Action.LEFT_CLICK_AIR || action == Action.LEFT_CLICK_BLOCK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -494,6 +494,7 @@ public class Enchants extends ItemStat<RandomEnchantListData, EnchantListData> i
|
|||||||
* @return Found bukkit enchantment instance
|
* @return Found bukkit enchantment instance
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
|
@Nullable
|
||||||
public static Enchantment getEnchant(String key) {
|
public static Enchantment getEnchant(String key) {
|
||||||
key = key.toLowerCase().replace("-", "_");
|
key = key.toLowerCase().replace("-", "_");
|
||||||
Enchantment enchant = Enchantment.getByKey(NamespacedKey.minecraft(key));
|
Enchantment enchant = Enchantment.getByKey(NamespacedKey.minecraft(key));
|
||||||
|
Loading…
Reference in New Issue
Block a user