mirror of
https://github.com/nulli0n/ExcellentEnchants-spigot.git
synced 2024-11-22 11:35:18 +01:00
v4.1.0
This commit is contained in:
parent
359782ff57
commit
9faac63acf
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>ExcellentEnchants</artifactId>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<version>4.0.5</version>
|
||||
<version>4.1.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.api;
|
||||
|
||||
@Deprecated
|
||||
public enum DistributionMode {
|
||||
|
||||
VANILLA,
|
||||
|
@ -2,6 +2,7 @@ package su.nightexpress.excellentenchants.api;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@Deprecated
|
||||
public enum DistributionWay {
|
||||
|
||||
ENCHANTING("Enchanting_Table"),
|
||||
|
@ -2,9 +2,7 @@ package su.nightexpress.excellentenchants.api.enchantment;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@ -38,12 +36,24 @@ public interface EnchantmentData {
|
||||
|
||||
boolean checkEnchantLimit(@NotNull ItemStack item);
|
||||
|
||||
boolean checkEnchantCategory(@NotNull ItemStack item);
|
||||
default boolean isSupportedItem(@NotNull ItemStack itemStack) {
|
||||
return this.getSupportedItems().is(itemStack);
|
||||
}
|
||||
|
||||
boolean checkItemCategory(@NotNull ItemStack item);
|
||||
default boolean isPrimaryItem(@NotNull ItemStack itemStack) {
|
||||
return this.getPrimaryItems().is(itemStack);
|
||||
}
|
||||
|
||||
default boolean hasItemCategory() {
|
||||
return this.getItemCategories().length != 0;
|
||||
/**
|
||||
* Items on which this enchantment can be applied using an anvil or using the /enchant command.
|
||||
*/
|
||||
@NotNull ItemsCategory getSupportedItems();
|
||||
|
||||
/**
|
||||
* Items for which this enchantment appears in an enchanting table.
|
||||
*/
|
||||
@NotNull default ItemsCategory getPrimaryItems() {
|
||||
return this.getSupportedItems();
|
||||
}
|
||||
|
||||
@NotNull DistributionOptions getDistributionOptions();
|
||||
@ -56,11 +66,13 @@ public interface EnchantmentData {
|
||||
|
||||
@NotNull String getName();
|
||||
|
||||
@Deprecated
|
||||
@NotNull
|
||||
default String getNameFormatted(int level) {
|
||||
return this.getNameFormatted(level, -1);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@NotNull String getNameFormatted(int level, int charges);
|
||||
|
||||
@NotNull List<String> getDescription();
|
||||
@ -69,16 +81,12 @@ public interface EnchantmentData {
|
||||
|
||||
@NotNull List<String> getDescriptionReplaced(int level);
|
||||
|
||||
@NotNull EnchantmentTarget getCategory();
|
||||
@NotNull List<String> getDescriptionReplaced(int level, int charges);
|
||||
|
||||
@NotNull Enchantment getEnchantment();
|
||||
|
||||
void setEnchantment(@NotNull Enchantment enchantment);
|
||||
|
||||
ItemCategory[] getItemCategories();
|
||||
|
||||
EquipmentSlot[] getSlots();
|
||||
|
||||
default boolean hasConflicts() {
|
||||
return !this.getConflicts().isEmpty();
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import su.nightexpress.nightcore.util.ItemUtil;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
|
||||
@Deprecated
|
||||
public enum ItemCategory {
|
||||
|
||||
HELMET(ItemUtil::isHelmet),
|
||||
|
@ -0,0 +1,148 @@
|
||||
package su.nightexpress.excellentenchants.api.enchantment;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Tag;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import su.nightexpress.nightcore.language.entry.LangString;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class ItemsCategory {
|
||||
|
||||
private final Supplier<Set<Material>> supplier;
|
||||
private final EquipmentSlot[] slots;
|
||||
private final EnchantmentTarget target;
|
||||
private final String localized;
|
||||
|
||||
public ItemsCategory(@NotNull Supplier<Set<Material>> supplier, EquipmentSlot[] slots, @Nullable EnchantmentTarget target, @Nullable String localized) {
|
||||
this.supplier = supplier;
|
||||
this.slots = slots;
|
||||
this.target = target;
|
||||
this.localized = localized;
|
||||
}
|
||||
|
||||
public boolean is(@NotNull ItemStack itemStack) {
|
||||
return this.getMaterials().contains(itemStack.getType());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Builder buildDirect(@NotNull Set<Material> materials) {
|
||||
return buildRef(() -> materials);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Builder buildDirect(Material... materials) {
|
||||
return buildDirect(Stream.of(materials).collect(Collectors.toSet()));
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
@NotNull
|
||||
public static Builder buildDirect(Tag<Material>... tags) {
|
||||
return buildDirect(Stream.of(tags).flatMap(tag -> tag.getValues().stream()).collect(Collectors.toSet()));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Builder buildRef(@NotNull Supplier<Set<Material>> supplier) {
|
||||
return new Builder().supplier(supplier);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Set<Material> getMaterials() {
|
||||
return this.supplier.get();
|
||||
}
|
||||
|
||||
public EquipmentSlot[] getSlots() {
|
||||
return slots;
|
||||
}
|
||||
|
||||
/**
|
||||
* Only for compatibility reasons with versions < 1.21
|
||||
*/
|
||||
public EnchantmentTarget getTarget() {
|
||||
return target;
|
||||
}
|
||||
|
||||
public String getLocalized() {
|
||||
return localized;
|
||||
}
|
||||
|
||||
/*@NotNull
|
||||
public static ItemsCategory create(@NotNull Set<Material> materials, EquipmentSlot... slots) {
|
||||
return new ItemsCategory(() -> materials);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static ItemsCategory create(Material... materials) {
|
||||
return create(Stream.of(materials).collect(Collectors.toSet()));
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
@NotNull
|
||||
public static ItemsCategory create(Tag<Material>... tags) {
|
||||
return create(Stream.of(tags).flatMap(tag -> tag.getValues().stream()).collect(Collectors.toSet()));
|
||||
}*/
|
||||
|
||||
// @NotNull
|
||||
// @Deprecated
|
||||
// public static ItemsCategory fusion(ItemsCategory... categories) {
|
||||
// Set<Supplier<Set<Material>>> suppliers = Stream.of(categories).map(category -> category.supplier).collect(Collectors.toSet());
|
||||
// Supplier<Set<Material>> result = () -> suppliers.stream().flatMap(supplier -> supplier.get().stream()).collect(Collectors.toSet());
|
||||
//
|
||||
// return new ItemsCategory(result, categories[0].getSlots(), categories[0].target, categories[0].localized);
|
||||
// }
|
||||
|
||||
public static class Builder {
|
||||
|
||||
private Supplier<Set<Material>> supplier;
|
||||
private EquipmentSlot[] slots;
|
||||
private EnchantmentTarget target;
|
||||
private String localized;
|
||||
|
||||
public Builder() {
|
||||
this.supplier = HashSet::new;
|
||||
this.slots = new EquipmentSlot[0];
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ItemsCategory build() {
|
||||
return new ItemsCategory(this.supplier, this.slots, this.target, this.localized);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Builder slots(EquipmentSlot... slots) {
|
||||
this.slots = slots;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Builder supplier(@NotNull Supplier<Set<Material>> supplier) {
|
||||
this.supplier = supplier;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Builder target(EnchantmentTarget target) {
|
||||
this.target = target;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Builder localized(@NotNull LangString localized) {
|
||||
return this.localized(localized.getString());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Builder localized(@Nullable String localized) {
|
||||
this.localized = localized;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
@ -6,6 +6,7 @@ import su.nightexpress.nightcore.util.random.Rnd;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Deprecated
|
||||
public enum Rarity {
|
||||
|
||||
COMMON(10),
|
||||
|
@ -3,6 +3,7 @@ package su.nightexpress.excellentenchants.api.enchantment.distribution;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
|
||||
@Deprecated
|
||||
public interface DistributionOptions {
|
||||
|
||||
void load(@NotNull FileConfig config);
|
||||
|
21
Core/pom.xml
21
Core/pom.xml
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>ExcellentEnchants</artifactId>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<version>4.0.5</version>
|
||||
<version>4.1.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -67,37 +67,42 @@
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>API</artifactId>
|
||||
<version>4.0.5</version>
|
||||
<version>4.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>NMS</artifactId>
|
||||
<version>4.0.5</version>
|
||||
<version>4.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>MC_1_21</artifactId>
|
||||
<version>4.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>MC_1_20_6</artifactId>
|
||||
<version>4.0.5</version>
|
||||
<version>4.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>V1_20_R3</artifactId>
|
||||
<version>4.0.5</version>
|
||||
<version>4.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>V1_20_R2</artifactId>
|
||||
<version>4.0.5</version>
|
||||
<version>4.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>V1_20_R1</artifactId>
|
||||
<version>4.0.5</version>
|
||||
<version>4.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>su.nightexpress.excellentenchants</groupId>
|
||||
<artifactId>V1_19_R3</artifactId>
|
||||
<version>4.0.5</version>
|
||||
<version>4.1.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -1,11 +1,9 @@
|
||||
package su.nightexpress.excellentenchants;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.event.block.BlockDropItemEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemCategory;
|
||||
import su.nightexpress.excellentenchants.api.DistributionWay;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.command.*;
|
||||
@ -16,9 +14,10 @@ import su.nightexpress.excellentenchants.config.Perms;
|
||||
import su.nightexpress.excellentenchants.enchantment.EnchantManager;
|
||||
import su.nightexpress.excellentenchants.enchantment.EnchantPopulator;
|
||||
import su.nightexpress.excellentenchants.enchantment.registry.EnchantRegistry;
|
||||
import su.nightexpress.excellentenchants.enchantment.util.EnchantUtils;
|
||||
import su.nightexpress.excellentenchants.hook.HookPlugin;
|
||||
import su.nightexpress.excellentenchants.hook.impl.PlaceholderHook;
|
||||
import su.nightexpress.excellentenchants.hook.impl.ProtocolHook;
|
||||
import su.nightexpress.excellentenchants.hook.impl.ProtocolLibHook;
|
||||
import su.nightexpress.excellentenchants.nms.EnchantNMS;
|
||||
import su.nightexpress.excellentenchants.nms.v1_19_R3.V1_19_R3;
|
||||
import su.nightexpress.excellentenchants.nms.v1_20_R1.V1_20_R1;
|
||||
@ -41,6 +40,7 @@ public class EnchantsPlugin extends NightPlugin {
|
||||
public void onLoad() {
|
||||
super.onLoad();
|
||||
this.registry = new EnchantRegistry(this);
|
||||
EnchantUtils.hook(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -60,8 +60,8 @@ public class EnchantsPlugin extends NightPlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
this.getLangManager().loadEnum(ItemCategory.class);
|
||||
this.getLangManager().loadEnum(EnchantmentTarget.class);
|
||||
//this.getLangManager().loadEnum(ItemCategory.class);
|
||||
//this.getLangManager().loadEnum(EnchantmentTarget.class);
|
||||
this.getLangManager().loadEnum(DistributionWay.class);
|
||||
this.getLangManager().loadEnum(Rarity.class);
|
||||
|
||||
@ -75,15 +75,22 @@ public class EnchantsPlugin extends NightPlugin {
|
||||
this.enchantManager = new EnchantManager(this);
|
||||
this.enchantManager.setup();
|
||||
|
||||
if (Config.ENCHANTMENTS_DISPLAY_MODE.get() == 2) {
|
||||
if (Plugins.isInstalled(HookPlugin.PROTOCOL_LIB)) {
|
||||
ProtocolLibHook.setup(this);
|
||||
}
|
||||
else {
|
||||
this.warn(HookPlugin.PROTOCOL_LIB + " is not installed. Enchantment descriptions won't be displayed.");
|
||||
}
|
||||
|
||||
/*if (Config.ENCHANTMENTS_DISPLAY_MODE.get() == 2) {
|
||||
if (Plugins.isInstalled(HookPlugin.PROTOCOL_LIB)) {
|
||||
ProtocolHook.setup(this);
|
||||
ProtocolLibHook.setup(this);
|
||||
}
|
||||
else {
|
||||
this.warn(HookPlugin.PROTOCOL_LIB + " is not installed. Display mode is set to Plain lore.");
|
||||
Config.ENCHANTMENTS_DISPLAY_MODE.set(1);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
if (Plugins.hasPlaceholderAPI()) {
|
||||
PlaceholderHook.setup(this);
|
||||
@ -111,6 +118,7 @@ public class EnchantsPlugin extends NightPlugin {
|
||||
case V1_20_R2 -> new V1_20_R2();
|
||||
case V1_20_R3 -> new V1_20_R3();
|
||||
case MC_1_20_6 -> new Internal1_20_6();
|
||||
case MC_1_21 -> new Internal_1_21(this);
|
||||
default -> null;
|
||||
};
|
||||
return this.enchantNMS != null;
|
||||
|
@ -69,7 +69,7 @@ public class BookCommand extends AbstractCommand<EnchantsPlugin> {
|
||||
|
||||
ItemStack item = new ItemStack(Material.ENCHANTED_BOOK);
|
||||
EnchantUtils.add(item, enchantment, level, true);
|
||||
EnchantUtils.updateDisplay(item);
|
||||
//EnchantUtils.updateDisplay(item);
|
||||
Players.addItem(player, item);
|
||||
|
||||
Lang.COMMAND_BOOK_DONE.getMessage()
|
||||
|
@ -82,7 +82,7 @@ public class EnchantCommand extends AbstractCommand<EnchantsPlugin> {
|
||||
}
|
||||
else EnchantUtils.remove(item, enchantment);
|
||||
|
||||
EnchantUtils.updateDisplay(item);
|
||||
//EnchantUtils.updateDisplay(item);
|
||||
player.getInventory().setItem(slot, item);
|
||||
|
||||
(sender == player ? Lang.COMMAND_ENCHANT_DONE_SELF : Lang.COMMAND_ENCHANT_DONE_OTHERS).getMessage()
|
||||
|
@ -80,7 +80,7 @@ public class RarityBookCommand extends AbstractCommand<EnchantsPlugin> {
|
||||
|
||||
ItemStack item = new ItemStack(Material.ENCHANTED_BOOK);
|
||||
EnchantUtils.add(item, enchantmentData.getEnchantment(), level, true);
|
||||
EnchantUtils.updateDisplay(item);
|
||||
//EnchantUtils.updateDisplay(item);
|
||||
Players.addItem(player, item);
|
||||
|
||||
Lang.COMMAND_RARITY_BOOK_DONE.getMessage()
|
||||
|
@ -141,6 +141,7 @@ public class Config {
|
||||
|
||||
|
||||
|
||||
@Deprecated
|
||||
public static final ConfigValue<Integer> ENCHANTMENTS_DISPLAY_MODE = ConfigValue.create("Enchantments.Display.Mode",
|
||||
1,
|
||||
"Sets how enchantment names and descriptions will be handled on items.",
|
||||
@ -152,6 +153,7 @@ public class Config {
|
||||
"Packet mode is slower, but instantly reflect all changes. In creative mode, there is a chance for lore duplication."
|
||||
);
|
||||
|
||||
@Deprecated
|
||||
public static final ConfigValue<Boolean> ENCHANTMENTS_DISPLAY_NAME_HIDE_1ST_LEVEL = ConfigValue.create("Enchantments.Display.Name.Hide_1st_Level",
|
||||
true,
|
||||
"Hides enchantment level component from name format for level 1 enchantments.");
|
||||
@ -198,9 +200,8 @@ public class Config {
|
||||
"Sets whether or not only enchanted books will have enchantment descriptions.");
|
||||
|
||||
public static final ConfigValue<String> ENCHANTMENTS_DISPLAY_DESCRIPTION_FORMAT = ConfigValue.create("Enchantments.Display.Description.Format",
|
||||
LIGHT_GRAY.enclose("• " + GENERIC_DESCRIPTION),
|
||||
"Sets enc" +
|
||||
"hantment description format.");
|
||||
LIGHT_GRAY.enclose("• " + ENCHANTMENT_NAME + " " + ENCHANTMENT_CHARGES + ": " + GENERIC_DESCRIPTION),
|
||||
"Sets enchantment description format.");
|
||||
|
||||
|
||||
|
||||
|
@ -4,6 +4,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniInt;
|
||||
|
||||
@Deprecated
|
||||
public class DistributionWaySettings {
|
||||
|
||||
private final boolean enabled;
|
||||
|
@ -6,6 +6,7 @@ import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
|
||||
public class Keys {
|
||||
|
||||
@Deprecated
|
||||
public static NamespacedKey loreSize;
|
||||
|
||||
public static NamespacedKey itemRecharged;
|
||||
|
@ -71,4 +71,31 @@ public class Lang extends CoreLang {
|
||||
public static final LangText ERROR_INVALID_RARITY = LangText.of("Error.InvalidRarity",
|
||||
RED.enclose("Invalid rarity!"));
|
||||
|
||||
public static final LangString ITEM_CATEGORY_HELMET = LangString.of("ItemCategory.Helmet", "Helmet");
|
||||
public static final LangString ITEM_CATEGORY_CHESTPLATE = LangString.of("ItemCategory.Chestplate", "Chestplate");
|
||||
public static final LangString ITEM_CATEGORY_LEGGINGS = LangString.of("ItemCategory.Leggings", "Leggings");
|
||||
public static final LangString ITEM_CATEGORY_BOOTS = LangString.of("ItemCategory.Boots", "Boots");
|
||||
public static final LangString ITEM_CATEGORY_ELYTRA = LangString.of("ItemCategory.Elytra", "Elytra");
|
||||
|
||||
public static final LangString ITEM_CATEGORY_SWORD = LangString.of("ItemCategory.Sword", "Sword");
|
||||
public static final LangString ITEM_CATEGORY_AXE = LangString.of("ItemCategory.Axe", "Axe");
|
||||
public static final LangString ITEM_CATEGORY_HOE = LangString.of("ItemCategory.Hoe", "Hoe");
|
||||
public static final LangString ITEM_CATEGORY_PICKAXE = LangString.of("ItemCategory.Pickaxe", "Pickaxe");
|
||||
public static final LangString ITEM_CATEGORY_SHOVEL = LangString.of("ItemCategory.Shovel", "Shovel");
|
||||
public static final LangString ITEM_CATEGORY_TRIDENT = LangString.of("ItemCategory.Trident", "Trident");
|
||||
public static final LangString ITEM_CATEGORY_BOW = LangString.of("ItemCategory.Bow", "Bow");
|
||||
public static final LangString ITEM_CATEGORY_CROSSBOW = LangString.of("ItemCategory.Crossbow", "Crossbow");
|
||||
public static final LangString ITEM_CATEGORY_FISHING_ROD = LangString.of("ItemCategory.FishingRod", "FishingRod");
|
||||
public static final LangString ITEM_CATEGORY_SHIELD = LangString.of("ItemCategory.Shield", "Shield");
|
||||
|
||||
public static final LangString ITEM_CATEGORY_BREAKABLE = LangString.of("ItemCategory.Breakable", "Breakable");
|
||||
public static final LangString ITEM_CATEGORY_ARMOR = LangString.of("ItemCategory.Armor", "Armor");
|
||||
public static final LangString ITEM_CATEGORY_TOOL = LangString.of("ItemCategory.Tool", "Tool");
|
||||
public static final LangString ITEM_CATEGORY_WEAPON = LangString.of("ItemCategory.Weapon", "Sword/Axe");
|
||||
public static final LangString ITEM_CATEGORY_BOWS = LangString.of("ItemCategory.Bows", "Bow/Crossbow");
|
||||
public static final LangString ITEM_CATEGORY_TORSO = LangString.of("ItemCategory.Torso", "Chestplate/Elytra");
|
||||
public static final LangString ITEM_CATEGORY_ALL_WEAPON = LangString.of("ItemCategory.AllWeapon", "All Weapon");
|
||||
public static final LangString ITEM_CATEGORY_MINING_TOOLS = LangString.of("ItemCategory.MiningTools", "Mining Tools");
|
||||
|
||||
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ public class Perms {
|
||||
public static final UniPermission COMMAND_ENCHANT = new UniPermission(PREFIX_COMMAND + "enchant");
|
||||
public static final UniPermission COMMAND_GET_FUEL = new UniPermission(PREFIX_COMMAND + "getfuel");
|
||||
public static final UniPermission COMMAND_LIST = new UniPermission(PREFIX_COMMAND + "list", PermissionDefault.TRUE);
|
||||
public static final UniPermission COMMAND_LIST_OTHERS = new UniPermission(PREFIX_COMMAND + "list.others");
|
||||
public static final UniPermission COMMAND_LIST_OTHERS = new UniPermission(PREFIX_COMMAND + "list.others");
|
||||
public static final UniPermission COMMAND_RARITY_BOOK = new UniPermission(PREFIX_COMMAND + "raritybook");
|
||||
public static final UniPermission COMMAND_RELOAD = new UniPermission(PREFIX_COMMAND + "reload");
|
||||
|
||||
|
@ -17,6 +17,7 @@ import su.nightexpress.excellentenchants.enchantment.registry.EnchantRegistry;
|
||||
import su.nightexpress.excellentenchants.enchantment.util.EnchantUtils;
|
||||
import su.nightexpress.nightcore.manager.AbstractManager;
|
||||
import su.nightexpress.nightcore.util.Pair;
|
||||
import su.nightexpress.nightcore.util.Version;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@ -48,7 +49,7 @@ public class EnchantManager extends AbstractManager<EnchantsPlugin> {
|
||||
this.plugin.info("Using custom distribution system. Applying patches...");
|
||||
this.addListener(new EnchantPopulationListener(this.plugin));
|
||||
}
|
||||
else {
|
||||
else if (Version.isBehind(Version.MC_1_21)) {
|
||||
this.plugin.info("Using vanilla distribution. Applying enchanting table patches...");
|
||||
this.addListener(new EnchantVanillaListener(this.plugin));
|
||||
}
|
||||
|
@ -253,9 +253,9 @@ public class EnchantPopulator {
|
||||
}
|
||||
});
|
||||
|
||||
if (status.get()) {
|
||||
/*if (status.get()) {
|
||||
EnchantUtils.updateDisplay(item);
|
||||
}
|
||||
}*/
|
||||
|
||||
return status.get();
|
||||
}
|
||||
|
@ -4,9 +4,7 @@ import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@ -16,7 +14,6 @@ import su.nightexpress.excellentenchants.api.DistributionWay;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Cost;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.EnchantmentData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PeriodicData;
|
||||
@ -41,7 +38,6 @@ import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
|
||||
@ -184,7 +180,7 @@ public abstract class AbstractEnchantmentData extends AbstractFileData<EnchantsP
|
||||
// TODO Check what actually does
|
||||
this.setAnvilCost(ConfigValue.create("Anvil.Cost",
|
||||
Rnd.get(8) + 1,
|
||||
"Sets enchantment anvil cost.",
|
||||
"The cost when applying this enchantment using an anvil. Halved when adding to a book, multiplied by the level of the enchantment.",
|
||||
"[*] Works for 1.20.6+ only!"
|
||||
).read(cfg));
|
||||
|
||||
@ -192,19 +188,6 @@ public abstract class AbstractEnchantmentData extends AbstractFileData<EnchantsP
|
||||
|
||||
|
||||
|
||||
/*this.setAnvilMergeCost(Modifier.read(cfg, "Anvil.Merge.Cost",
|
||||
Modifier.add(1, 1, 1),
|
||||
"Sets XP cost to apply or transfer this enchantment using anvils."
|
||||
));
|
||||
|
||||
this.setMaxMergeLevel(ConfigValue.create("Anvil.Merge.Max_Level",
|
||||
-1,
|
||||
"Max. enchantment level that can be obtained by combining 2 items with this enchantment.",
|
||||
"Set to '-1' to remove limit and cap to max. enchantment level."
|
||||
).read(cfg));*/
|
||||
|
||||
|
||||
|
||||
if (Config.ENCHANTMENTS_CHARGES_ENABLED.get() && !this.isCurse()) {
|
||||
this.setChargesEnabled(ConfigValue.create("Charges.Enabled",
|
||||
false,
|
||||
@ -250,11 +233,7 @@ public abstract class AbstractEnchantmentData extends AbstractFileData<EnchantsP
|
||||
.add(ENCHANTMENT_LEVEL_MIN, () -> String.valueOf(1))
|
||||
.add(ENCHANTMENT_LEVEL_MAX, () -> String.valueOf(this.getMaxLevel()))
|
||||
.add(ENCHANTMENT_RARITY, () -> plugin.getLangManager().getEnum(this.getRarity()))
|
||||
.add(ENCHANTMENT_FIT_ITEM_TYPES, () -> {
|
||||
if (this.getItemCategories().length == 0) return plugin.getLangManager().getEnum(this.getCategory());
|
||||
|
||||
return String.join(", ", Stream.of(this.getItemCategories()).map(type -> plugin.getLangManager().getEnum(type)).toList());
|
||||
})
|
||||
.add(ENCHANTMENT_FIT_ITEM_TYPES, () -> this.getSupportedItems().getLocalized())
|
||||
.add(ENCHANTMENT_CHARGES_MAX_AMOUNT, level -> NumberUtil.format(this.getChargesMax(level)))
|
||||
.add(ENCHANTMENT_CHARGES_CONSUME_AMOUNT, level -> NumberUtil.format(this.getChargesConsumeAmount(level)))
|
||||
.add(ENCHANTMENT_CHARGES_RECHARGE_AMOUNT, level -> NumberUtil.format(this.getChargesRechargeAmount(level)))
|
||||
@ -316,13 +295,13 @@ public abstract class AbstractEnchantmentData extends AbstractFileData<EnchantsP
|
||||
this.placeholders.add(key, replacer);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ItemCategory[] getItemCategories() {
|
||||
return new ItemCategory[0];
|
||||
}
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public ItemCategory[] getItemCategories() {
|
||||
// return new ItemCategory[0];
|
||||
// }
|
||||
|
||||
@Override
|
||||
/*@Override
|
||||
public EquipmentSlot[] getSlots() {
|
||||
return switch (this.getCategory()) {
|
||||
case BOW, CROSSBOW, TRIDENT, FISHING_ROD, WEAPON, TOOL -> new EquipmentSlot[]{EquipmentSlot.HAND};
|
||||
@ -335,7 +314,7 @@ public abstract class AbstractEnchantmentData extends AbstractFileData<EnchantsP
|
||||
case VANISHABLE -> EnchantUtils.EQUIPMENT_SLOTS;
|
||||
default -> throw new IllegalStateException("Unexpected value: " + this.getCategory());
|
||||
};
|
||||
}
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public boolean isAvailableToUse(@NotNull World world) {
|
||||
@ -358,7 +337,7 @@ public abstract class AbstractEnchantmentData extends AbstractFileData<EnchantsP
|
||||
return !EnchantUtils.hasMaximumEnchants(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
/*@Override
|
||||
public final boolean checkEnchantCategory(@NotNull ItemStack item) {
|
||||
EnchantmentTarget category = this.getCategory();
|
||||
|
||||
@ -377,7 +356,7 @@ public abstract class AbstractEnchantmentData extends AbstractFileData<EnchantsP
|
||||
@Override
|
||||
public boolean checkItemCategory(@NotNull ItemStack item) {
|
||||
return !this.hasItemCategory() || Stream.of(this.getItemCategories()).anyMatch(itemCategory -> itemCategory.isIncluded(item));
|
||||
}
|
||||
}*/
|
||||
|
||||
public int generateLevel() {
|
||||
return Rnd.get(1, this.getMaxLevel());
|
||||
@ -386,28 +365,9 @@ public abstract class AbstractEnchantmentData extends AbstractFileData<EnchantsP
|
||||
@Override
|
||||
@NotNull
|
||||
public String getNameFormatted(int level, int charges) {
|
||||
String rarityFormat = this.isCurse() ? Config.ENCHANTMENTS_DISPLAY_NAME_CURSE_FORMAT.get() : Config.ENCHANTMENTS_DISPLAY_NAME_RARITY_FORMAT.get().getOrDefault(this.getRarity(), GENERIC_NAME);
|
||||
String chargesFormat = "";
|
||||
boolean showLevel = !Config.ENCHANTMENTS_DISPLAY_NAME_HIDE_1ST_LEVEL.get() || level > 1;
|
||||
boolean showCharges = this.isChargesEnabled() && charges >= 0;
|
||||
|
||||
if (showCharges) {
|
||||
int chargesMax = this.getChargesMax(level);
|
||||
int percent = (int) Math.ceil((double) charges / (double) chargesMax * 100D);
|
||||
Map.Entry<Integer, String> entry = Config.ENCHANTMENTS_CHARGES_FORMAT.get().floorEntry(percent);
|
||||
if (entry != null) {
|
||||
chargesFormat = entry.getValue().replace(GENERIC_AMOUNT, String.valueOf(charges));
|
||||
}
|
||||
}
|
||||
|
||||
String compName = Config.ENCHANTMENTS_DISPLAY_NAME_COMPONENT_NAME.get().replace(GENERIC_VALUE, this.getName());
|
||||
String compLevel = showLevel ? Config.ENCHANTMENTS_DISPLAY_NAME_COMPONENT_LEVEL.get().replace(GENERIC_VALUE, NumberUtil.toRoman(level)) : "";
|
||||
String compChrages = showCharges ? Config.ENCHANTMENTS_DISPLAY_NAME_COMPONENT_CHARGES.get().replace(GENERIC_VALUE, chargesFormat) : "";
|
||||
|
||||
String nameFormat = Config.ENCHANTMENTS_DISPLAY_NAME_FORMAT.get().
|
||||
replace(ENCHANTMENT_NAME, compName)
|
||||
.replace(ENCHANTMENT_LEVEL, compLevel)
|
||||
.replace(ENCHANTMENT_CHARGES, compChrages);
|
||||
String rarityFormat = this.isCurse() ? Config.ENCHANTMENTS_DISPLAY_NAME_CURSE_FORMAT.get() : Config.ENCHANTMENTS_DISPLAY_NAME_RARITY_FORMAT.get()
|
||||
.getOrDefault(this.getRarity(), GENERIC_NAME);
|
||||
String nameFormat = this.formatComponents(Config.ENCHANTMENTS_DISPLAY_NAME_FORMAT.get(), level, charges);
|
||||
|
||||
return rarityFormat.replace(GENERIC_NAME, nameFormat);
|
||||
}
|
||||
@ -423,11 +383,42 @@ public abstract class AbstractEnchantmentData extends AbstractFileData<EnchantsP
|
||||
@Override
|
||||
@NotNull
|
||||
public List<String> getDescriptionReplaced(int level) {
|
||||
return this.getDescriptionReplaced(level, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public List<String> getDescriptionReplaced(int level, int charges) {
|
||||
List<String> description = new ArrayList<>(this.getDescriptionFormatted());
|
||||
description.replaceAll(this.getPlaceholders(level).replacer());
|
||||
description.replaceAll(line -> this.getPlaceholders(level).replacer().apply(this.formatComponents(line, level, charges)));
|
||||
return description;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private String formatComponents(@NotNull String string, int level, int charges) {
|
||||
String chargesFormat = "";
|
||||
boolean showLevel = this.getMaxLevel() > 1;
|
||||
boolean showCharges = this.isChargesEnabled() && charges >= 0;
|
||||
|
||||
if (showCharges) {
|
||||
int chargesMax = this.getChargesMax(level);
|
||||
int percent = (int) Math.ceil((double) charges / (double) chargesMax * 100D);
|
||||
Map.Entry<Integer, String> entry = Config.ENCHANTMENTS_CHARGES_FORMAT.get().floorEntry(percent);
|
||||
if (entry != null) {
|
||||
chargesFormat = entry.getValue().replace(GENERIC_AMOUNT, String.valueOf(charges));
|
||||
}
|
||||
}
|
||||
|
||||
String compName = Config.ENCHANTMENTS_DISPLAY_NAME_COMPONENT_NAME.get().replace(GENERIC_VALUE, this.getName());
|
||||
String compLevel = showLevel ? Config.ENCHANTMENTS_DISPLAY_NAME_COMPONENT_LEVEL.get().replace(GENERIC_VALUE, NumberUtil.toRoman(level)) : "";
|
||||
String compChrages = showCharges ? Config.ENCHANTMENTS_DISPLAY_NAME_COMPONENT_CHARGES.get().replace(GENERIC_VALUE, chargesFormat) : "";
|
||||
|
||||
return string
|
||||
.replace(ENCHANTMENT_NAME, compName)
|
||||
.replace(ENCHANTMENT_LEVEL, compLevel)
|
||||
.replace(ENCHANTMENT_CHARGES, compChrages);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinCost(int level) {
|
||||
return this.getMinCost().calculate(level);
|
||||
@ -525,7 +516,7 @@ public abstract class AbstractEnchantmentData extends AbstractFileData<EnchantsP
|
||||
if (!this.isChargesEnabled()) return;
|
||||
|
||||
this.consumeChargesNoUpdate(item, level);
|
||||
EnchantUtils.updateDisplay(item);
|
||||
//EnchantUtils.updateDisplay(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -0,0 +1,171 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.data;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Tag;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.config.Config;
|
||||
import su.nightexpress.excellentenchants.config.Lang;
|
||||
import su.nightexpress.nightcore.util.BukkitThing;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public class ItemCategories {
|
||||
|
||||
public static final ItemsCategory HELMET = ItemsCategory.buildDirect(getItemsBySlot(EquipmentSlot.HEAD)).slots(EquipmentSlot.HEAD)
|
||||
.localized(Lang.ITEM_CATEGORY_HELMET)
|
||||
.target(EnchantmentTarget.ARMOR_HEAD).build();
|
||||
|
||||
public static final ItemsCategory CHESTPLATE = ItemsCategory.buildDirect(getItemsBySlot(EquipmentSlot.CHEST)).slots(EquipmentSlot.CHEST)
|
||||
.localized(Lang.ITEM_CATEGORY_CHESTPLATE)
|
||||
.target(EnchantmentTarget.ARMOR_TORSO).build();
|
||||
|
||||
public static final ItemsCategory LEGGINGS = ItemsCategory.buildDirect(getItemsBySlot(EquipmentSlot.LEGS)).slots(EquipmentSlot.LEGS)
|
||||
.localized(Lang.ITEM_CATEGORY_LEGGINGS)
|
||||
.target(EnchantmentTarget.ARMOR_LEGS).build();
|
||||
|
||||
public static final ItemsCategory BOOTS = ItemsCategory.buildDirect(getItemsBySlot(EquipmentSlot.FEET)).slots(EquipmentSlot.FEET)
|
||||
.localized(Lang.ITEM_CATEGORY_BOOTS)
|
||||
.target(EnchantmentTarget.ARMOR_FEET).build();
|
||||
|
||||
public static final ItemsCategory ELYTRA = ItemsCategory.buildDirect(Material.ELYTRA).slots(EquipmentSlot.CHEST)
|
||||
.localized(Lang.ITEM_CATEGORY_ELYTRA)
|
||||
.target(EnchantmentTarget.ARMOR_TORSO).build();
|
||||
|
||||
public static final ItemsCategory SWORD = ItemsCategory.buildDirect(Tag.ITEMS_SWORDS).slots(EquipmentSlot.HAND)
|
||||
.localized(Lang.ITEM_CATEGORY_SWORD)
|
||||
.target(EnchantmentTarget.WEAPON).build();
|
||||
|
||||
public static final ItemsCategory AXE = ItemsCategory.buildDirect(Tag.ITEMS_AXES).slots(EquipmentSlot.HAND)
|
||||
.localized(Lang.ITEM_CATEGORY_AXE)
|
||||
.target(EnchantmentTarget.TOOL).build();
|
||||
|
||||
public static final ItemsCategory HOE = ItemsCategory.buildDirect(Tag.ITEMS_HOES).slots(EquipmentSlot.HAND)
|
||||
.localized(Lang.ITEM_CATEGORY_HOE)
|
||||
.target(EnchantmentTarget.TOOL).build();
|
||||
|
||||
public static final ItemsCategory PICKAXE = ItemsCategory.buildDirect(Tag.ITEMS_PICKAXES).slots(EquipmentSlot.HAND)
|
||||
.localized(Lang.ITEM_CATEGORY_PICKAXE)
|
||||
.target(EnchantmentTarget.TOOL).build();
|
||||
|
||||
public static final ItemsCategory SHOVEL = ItemsCategory.buildDirect(Tag.ITEMS_SHOVELS).slots(EquipmentSlot.HAND)
|
||||
.localized(Lang.ITEM_CATEGORY_SHOVEL)
|
||||
.target(EnchantmentTarget.TOOL).build();
|
||||
|
||||
public static final ItemsCategory TRIDENT = ItemsCategory.buildDirect(Material.TRIDENT).slots(EquipmentSlot.HAND, EquipmentSlot.OFF_HAND)
|
||||
.localized(Lang.ITEM_CATEGORY_TRIDENT)
|
||||
.target(EnchantmentTarget.TRIDENT).build();
|
||||
|
||||
public static final ItemsCategory BOW = ItemsCategory.buildDirect(Material.BOW).slots(EquipmentSlot.HAND, EquipmentSlot.OFF_HAND)
|
||||
.localized(Lang.ITEM_CATEGORY_BOW)
|
||||
.target(EnchantmentTarget.BOW).build();
|
||||
|
||||
public static final ItemsCategory CROSSBOW = ItemsCategory.buildDirect(Material.CROSSBOW).slots(EquipmentSlot.HAND, EquipmentSlot.OFF_HAND)
|
||||
.localized(Lang.ITEM_CATEGORY_CROSSBOW)
|
||||
.target(EnchantmentTarget.CROSSBOW).build();
|
||||
|
||||
public static final ItemsCategory FISHING_ROD = ItemsCategory.buildDirect(Material.FISHING_ROD).slots(EquipmentSlot.HAND, EquipmentSlot.OFF_HAND)
|
||||
.localized(Lang.ITEM_CATEGORY_FISHING_ROD)
|
||||
.target(EnchantmentTarget.FISHING_ROD).build();
|
||||
|
||||
public static final ItemsCategory SHIELD = ItemsCategory.buildDirect(Material.SHIELD).slots(EquipmentSlot.OFF_HAND)
|
||||
.localized(Lang.ITEM_CATEGORY_SHIELD)
|
||||
.target(EnchantmentTarget.BREAKABLE).build();
|
||||
|
||||
public static final ItemsCategory BREAKABLE = ItemsCategory.buildDirect(getItemsWithDurability()).slots(EquipmentSlot.values())
|
||||
.localized(Lang.ITEM_CATEGORY_BREAKABLE)
|
||||
.target(EnchantmentTarget.BREAKABLE).build();
|
||||
|
||||
public static final ItemsCategory ARMOR = ItemsCategory.buildRef(() -> {
|
||||
Set<Material> materials = new HashSet<>();
|
||||
materials.addAll(getItemsBySlot(EquipmentSlot.HEAD));
|
||||
materials.addAll(getItemsBySlot(EquipmentSlot.CHEST));
|
||||
materials.addAll(getItemsBySlot(EquipmentSlot.LEGS));
|
||||
materials.addAll(getItemsBySlot(EquipmentSlot.FEET));
|
||||
return materials;
|
||||
}).slots(EquipmentSlot.HEAD, EquipmentSlot.CHEST, EquipmentSlot.LEGS, EquipmentSlot.FEET).target(EnchantmentTarget.ARMOR).localized(Lang.ITEM_CATEGORY_ARMOR).build();
|
||||
|
||||
public static final ItemsCategory TOOL = ItemsCategory.buildDirect(
|
||||
Tag.ITEMS_AXES,
|
||||
Tag.ITEMS_HOES,
|
||||
Tag.ITEMS_PICKAXES,
|
||||
Tag.ITEMS_SHOVELS
|
||||
).slots(EquipmentSlot.HAND).target(EnchantmentTarget.TOOL).localized(Lang.ITEM_CATEGORY_TOOL).build();
|
||||
|
||||
|
||||
public static final ItemsCategory WEAPON = ItemsCategory.buildRef(() -> {
|
||||
Set<Material> materials = new HashSet<>(SWORD.getMaterials());
|
||||
|
||||
if (Config.CORE_SWORD_ENCHANTS_TO_AXES.get()) {
|
||||
materials.addAll(AXE.getMaterials());
|
||||
}
|
||||
|
||||
return materials;
|
||||
}).slots(EquipmentSlot.HAND).target(EnchantmentTarget.WEAPON).localized(Lang.ITEM_CATEGORY_WEAPON).build();
|
||||
|
||||
|
||||
public static final ItemsCategory BOWS = ItemsCategory.buildRef(() -> {
|
||||
Set<Material> materials = new HashSet<>(BOW.getMaterials());
|
||||
|
||||
if (Config.CORE_BOW_ENCHANTS_TO_CROSSBOW.get()) {
|
||||
materials.addAll(CROSSBOW.getMaterials());
|
||||
}
|
||||
|
||||
return materials;
|
||||
}).slots(EquipmentSlot.HAND, EquipmentSlot.OFF_HAND).target(EnchantmentTarget.BOW).localized(Lang.ITEM_CATEGORY_BOWS).build();
|
||||
|
||||
|
||||
public static final ItemsCategory TORSO = ItemsCategory.buildRef(() -> {
|
||||
Set<Material> materials = new HashSet<>(CHESTPLATE.getMaterials());
|
||||
|
||||
if (Config.CORE_CHESTPLATE_ENCHANTS_TO_ELYTRA.get()) {
|
||||
materials.addAll(ELYTRA.getMaterials());
|
||||
}
|
||||
|
||||
return materials;
|
||||
}).slots(EquipmentSlot.CHEST).target(EnchantmentTarget.ARMOR_TORSO).localized(Lang.ITEM_CATEGORY_TORSO).build();
|
||||
|
||||
|
||||
public static final ItemsCategory ALL_RANGE_WEAPON = ItemsCategory.buildRef(() -> {
|
||||
Set<Material> materials = new HashSet<>();
|
||||
materials.addAll(WEAPON.getMaterials());
|
||||
materials.addAll(BOWS.getMaterials());
|
||||
materials.addAll(TRIDENT.getMaterials());
|
||||
materials.addAll(TOOL.getMaterials());
|
||||
return materials;
|
||||
}).slots(EquipmentSlot.HAND).target(EnchantmentTarget.BREAKABLE).localized(Lang.ITEM_CATEGORY_ALL_WEAPON).build();
|
||||
|
||||
public static final ItemsCategory MINING_TOOLS = ItemsCategory.buildRef(() -> {
|
||||
Set<Material> materials = new HashSet<>();
|
||||
materials.addAll(AXE.getMaterials());
|
||||
materials.addAll(PICKAXE.getMaterials());
|
||||
materials.addAll(SHOVEL.getMaterials());
|
||||
return materials;
|
||||
}).slots(EquipmentSlot.HAND).target(EnchantmentTarget.TOOL).localized(Lang.ITEM_CATEGORY_MINING_TOOLS).build();
|
||||
|
||||
|
||||
@NotNull
|
||||
private static Set<Material> getItemsBySlot(@NotNull EquipmentSlot slot) {
|
||||
Set<Material> materials = new HashSet<>();
|
||||
BukkitThing.getMaterials().forEach(material -> {
|
||||
if (material.isItem() && material.getEquipmentSlot() == slot) {
|
||||
materials.add(material);
|
||||
}
|
||||
});
|
||||
return materials;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static Set<Material> getItemsWithDurability() {
|
||||
Set<Material> materials = new HashSet<>();
|
||||
BukkitThing.getMaterials().forEach(material -> {
|
||||
if (material.isItem() && material.getMaxDurability() > 0) {
|
||||
materials.add(material);
|
||||
}
|
||||
});
|
||||
return materials;
|
||||
}
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.armor;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
@ -9,6 +8,7 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
@ -17,6 +17,7 @@ import su.nightexpress.excellentenchants.api.enchantment.data.PotionSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PotionSettingsImpl;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
|
||||
@ -62,10 +63,16 @@ public class ColdSteelEnchant extends AbstractEnchantmentData implements ChanceD
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.ARMOR_TORSO;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.TORSO;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.ARMOR_TORSO;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getProtectPriority() {
|
||||
|
@ -1,7 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.armor;
|
||||
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
@ -10,6 +9,7 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
@ -18,6 +18,7 @@ import su.nightexpress.excellentenchants.api.enchantment.data.PotionSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PotionSettingsImpl;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
@ -64,10 +65,16 @@ public class DarknessCloakEnchant extends AbstractEnchantmentData implements Cha
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.ARMOR_TORSO;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.TORSO;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.ARMOR_TORSO;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getProtectPriority() {
|
||||
|
@ -1,6 +1,5 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.armor;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -9,19 +8,23 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.GenericEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.util.EnchantUtils;
|
||||
import su.nightexpress.nightcore.config.ConfigValue;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.manager.SimpeListener;
|
||||
import su.nightexpress.nightcore.util.EntityUtil;
|
||||
import su.nightexpress.nightcore.util.NumberUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Set;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_AMOUNT;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_MAX;
|
||||
|
||||
public class ElementalProtectionEnchant extends AbstractEnchantmentData implements SimpeListener, GenericEnchant {
|
||||
|
||||
@ -62,12 +65,18 @@ public class ElementalProtectionEnchant extends AbstractEnchantmentData implemen
|
||||
this.addPlaceholder(GENERIC_MAX, level -> NumberUtil.format(this.getProtectionCapacity()));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.ARMOR;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.ARMOR;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.ARMOR;
|
||||
// }
|
||||
|
||||
public double getProtectionAmount(int level) {
|
||||
return this.protectionAmount.getValue(level);
|
||||
}
|
||||
@ -86,8 +95,12 @@ public class ElementalProtectionEnchant extends AbstractEnchantmentData implemen
|
||||
if (!(event.getEntity() instanceof LivingEntity entity)) return;
|
||||
if (!this.isAvailableToUse(entity)) return;
|
||||
|
||||
// TODO Work as percent to ignore damage
|
||||
|
||||
double protectionAmount = 0D;
|
||||
for (ItemStack armor : EnchantUtils.getEnchantedEquipment(entity).values()) {
|
||||
for (ItemStack armor : EntityUtil.getEquippedArmor(entity).values()) {
|
||||
if (armor == null || armor.getType().isAir()) continue;
|
||||
|
||||
int level = EnchantUtils.getLevel(armor, this.getEnchantment());
|
||||
if (level <= 0) continue;
|
||||
|
||||
|
@ -2,7 +2,6 @@ package su.nightexpress.excellentenchants.enchantment.impl.armor;
|
||||
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
@ -10,12 +9,14 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.NumberUtil;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
@ -23,7 +24,8 @@ import su.nightexpress.nightcore.util.wrapper.UniSound;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_DURATION;
|
||||
|
||||
public class FireShieldEnchant extends AbstractEnchantmentData implements ChanceData, CombatEnchant {
|
||||
|
||||
@ -58,12 +60,18 @@ public class FireShieldEnchant extends AbstractEnchantmentData implements Chance
|
||||
return chanceSettings;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.ARMOR;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.ARMOR;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.ARMOR;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getProtectPriority() {
|
||||
|
@ -5,7 +5,6 @@ import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -20,9 +19,11 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.GenericEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.util.EnchantUtils;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.manager.SimpeListener;
|
||||
@ -107,10 +108,16 @@ public class FlameWalkerEnchant extends AbstractEnchantmentData implements Gener
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.ARMOR_FEET;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.BOOTS;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.ARMOR_FEET;
|
||||
// }
|
||||
|
||||
public double getBlockDecayTime(int level) {
|
||||
return this.blockDecayTime.getValue(level);
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.armor;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
@ -9,6 +8,7 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
@ -17,6 +17,7 @@ import su.nightexpress.excellentenchants.api.enchantment.data.PotionSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PotionSettingsImpl;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
|
||||
@ -62,10 +63,16 @@ public class HardenedEnchant extends AbstractEnchantmentData implements ChanceDa
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.ARMOR_TORSO;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.TORSO;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.ARMOR_TORSO;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getProtectPriority() {
|
||||
|
@ -3,7 +3,6 @@ package su.nightexpress.excellentenchants.enchantment.impl.armor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
@ -12,6 +11,7 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
@ -20,6 +20,7 @@ import su.nightexpress.excellentenchants.api.enchantment.data.PotionSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PotionSettingsImpl;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
@ -53,12 +54,18 @@ public class IceShieldEnchant extends AbstractEnchantmentData implements ChanceD
|
||||
);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.ARMOR_TORSO;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.TORSO;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.ARMOR_TORSO;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getProtectPriority() {
|
||||
|
@ -1,24 +1,26 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.armor;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PeriodicSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PotionData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PotionSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.PassiveEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PeriodSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PotionSettingsImpl;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_POTION_LEVEL;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_POTION_TYPE;
|
||||
|
||||
public class JumpingEnchant extends AbstractEnchantmentData implements PotionData, PassiveEnchant {
|
||||
|
||||
@ -54,10 +56,16 @@ public class JumpingEnchant extends AbstractEnchantmentData implements PotionDat
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.ARMOR_FEET;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.BOOTS;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.ARMOR_FEET;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onTrigger(@NotNull LivingEntity entity, @NotNull ItemStack item, int level) {
|
||||
return this.addEffect(entity, level);
|
||||
|
@ -1,7 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.armor;
|
||||
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
@ -15,12 +14,14 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.DeathEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.ConfigValue;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.manager.SimpeListener;
|
||||
@ -28,7 +29,7 @@ import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
|
||||
public class KamikadzeEnchant extends AbstractEnchantmentData implements ChanceData, DeathEnchant, SimpeListener {
|
||||
|
||||
@ -70,10 +71,16 @@ public class KamikadzeEnchant extends AbstractEnchantmentData implements ChanceD
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.ARMOR_TORSO;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.TORSO;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.ARMOR_TORSO;
|
||||
// }
|
||||
|
||||
public boolean isApplyOnResurrect() {
|
||||
return this.applyOnResurrect;
|
||||
}
|
||||
|
@ -1,24 +1,26 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.armor;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PeriodicSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PotionData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PotionSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.PassiveEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PeriodSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PotionSettingsImpl;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_POTION_LEVEL;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_POTION_TYPE;
|
||||
|
||||
public class NightVisionEnchant extends AbstractEnchantmentData implements PotionData, PassiveEnchant {
|
||||
|
||||
@ -54,10 +56,16 @@ public class NightVisionEnchant extends AbstractEnchantmentData implements Potio
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.ARMOR_HEAD;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.HELMET;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.ARMOR_HEAD;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onTrigger(@NotNull LivingEntity entity, @NotNull ItemStack item, int level) {
|
||||
return this.addEffect(entity, level);
|
||||
|
@ -2,12 +2,12 @@ package su.nightexpress.excellentenchants.enchantment.impl.armor;
|
||||
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
@ -15,6 +15,7 @@ import su.nightexpress.excellentenchants.api.enchantment.data.PeriodicSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.PassiveEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PeriodSettingsImpl;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.EntityUtil;
|
||||
@ -81,12 +82,18 @@ public class RegrowthEnchant extends AbstractEnchantmentData implements ChanceDa
|
||||
return periodSettings;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.ARMOR_TORSO;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.TORSO;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.ARMOR_TORSO;
|
||||
// }
|
||||
|
||||
public double getHealAmount(int level) {
|
||||
return this.healAmount.getValue(level);
|
||||
}
|
||||
|
@ -1,23 +1,25 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.armor;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PeriodicSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.PassiveEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PeriodSettingsImpl;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.NumberUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_AMOUNT;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_MAX;
|
||||
|
||||
public class SaturationEnchant extends AbstractEnchantmentData implements PassiveEnchant {
|
||||
|
||||
@ -59,10 +61,16 @@ public class SaturationEnchant extends AbstractEnchantmentData implements Passiv
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.ARMOR_HEAD;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.HELMET;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.ARMOR_HEAD;
|
||||
// }
|
||||
|
||||
public final int getFeedAmount(int level) {
|
||||
return (int) this.feedAmount.getValue(level);
|
||||
}
|
||||
|
@ -1,24 +1,26 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.armor;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PeriodicSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PotionData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PotionSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.PassiveEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PeriodSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PotionSettingsImpl;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_POTION_LEVEL;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_POTION_TYPE;
|
||||
|
||||
public class SpeedyEnchant extends AbstractEnchantmentData implements PotionData, PassiveEnchant {
|
||||
|
||||
@ -54,10 +56,16 @@ public class SpeedyEnchant extends AbstractEnchantmentData implements PotionData
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.ARMOR_FEET;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.BOOTS;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.ARMOR_FEET;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onTrigger(@NotNull LivingEntity entity, @NotNull ItemStack item, int level) {
|
||||
return this.addEffect(entity, level);
|
||||
|
@ -1,6 +1,5 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.armor;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
@ -8,18 +7,21 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.NumberUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_AMOUNT;
|
||||
|
||||
public class StoppingForceEnchant extends AbstractEnchantmentData implements ChanceData, CombatEnchant {
|
||||
|
||||
@ -50,10 +52,16 @@ public class StoppingForceEnchant extends AbstractEnchantmentData implements Cha
|
||||
return this.knockbackModifier.getValue(level);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.ARMOR_LEGS;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.ARMOR_LEGS;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.LEGGINGS;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
@ -1,6 +1,5 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.armor;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -13,12 +12,14 @@ import org.bukkit.loot.LootTables;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.GenericEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.util.EnchantUtils;
|
||||
import su.nightexpress.nightcore.config.ConfigValue;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
@ -27,9 +28,12 @@ import su.nightexpress.nightcore.util.StringUtil;
|
||||
import su.nightexpress.nightcore.util.random.Rnd;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
|
||||
public class TreasureHunterEnchant extends AbstractEnchantmentData implements ChanceData, GenericEnchant, SimpeListener {
|
||||
|
||||
@ -92,10 +96,16 @@ public class TreasureHunterEnchant extends AbstractEnchantmentData implements Ch
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.ARMOR_HEAD;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.HELMET;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.ARMOR_HEAD;
|
||||
// }
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onLootExplore(LootGenerateEvent event) {
|
||||
if (this.lootTables.isEmpty()) return;
|
||||
|
@ -1,24 +1,26 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.armor;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PeriodicSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PotionData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PotionSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.PassiveEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PeriodSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PotionSettingsImpl;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_POTION_LEVEL;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_POTION_TYPE;
|
||||
|
||||
public class WaterBreathingEnchant extends AbstractEnchantmentData implements PotionData, PassiveEnchant {
|
||||
|
||||
@ -54,10 +56,16 @@ public class WaterBreathingEnchant extends AbstractEnchantmentData implements Po
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.ARMOR_HEAD;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.HELMET;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.ARMOR_HEAD;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onTrigger(@NotNull LivingEntity entity, @NotNull ItemStack item, int level) {
|
||||
return this.addEffect(entity, level);
|
||||
|
@ -1,7 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.bow;
|
||||
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Projectile;
|
||||
import org.bukkit.entity.TNTPrimed;
|
||||
@ -13,18 +12,21 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.BowEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.NumberUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_TIME;
|
||||
|
||||
public class BomberEnchant extends AbstractEnchantmentData implements ChanceData, BowEnchant {
|
||||
|
||||
@ -73,10 +75,16 @@ public class BomberEnchant extends AbstractEnchantmentData implements ChanceData
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.BOW;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.BOWS;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.BOW;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getShootPriority() {
|
||||
|
@ -1,7 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.bow;
|
||||
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.AbstractArrow;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
@ -14,13 +13,11 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.*;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.BowEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ArrowSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PotionSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.*;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
|
||||
@ -74,12 +71,18 @@ public class ConfusingArrowsEnchant extends AbstractEnchantmentData implements C
|
||||
return potionSettings;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.BOW;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.BOWS;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.BOW;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onShoot(@NotNull EntityShootBowEvent event, @NotNull LivingEntity shooter, @NotNull ItemStack bow, int level) {
|
||||
if (!(event.getProjectile() instanceof Arrow arrow)) return false;
|
||||
|
@ -1,7 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.bow;
|
||||
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.AbstractArrow;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
@ -14,13 +13,11 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.*;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.BowEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ArrowSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PotionSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.*;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
|
||||
@ -74,12 +71,18 @@ public class DarknessArrowsEnchant extends AbstractEnchantmentData implements Ch
|
||||
return potionSettings;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.BOW;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.BOWS;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.BOW;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onShoot(@NotNull EntityShootBowEvent event, @NotNull LivingEntity shooter, @NotNull ItemStack bow, int level) {
|
||||
if (!(event.getProjectile() instanceof Arrow arrow)) return false;
|
||||
|
@ -6,7 +6,6 @@ import org.bukkit.Particle;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.*;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.event.entity.EntityShootBowEvent;
|
||||
@ -21,6 +20,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ArrowData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ArrowSettings;
|
||||
@ -30,6 +30,7 @@ import su.nightexpress.excellentenchants.api.enchantment.type.BowEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ArrowSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.ItemUtil;
|
||||
import su.nightexpress.nightcore.util.NumberUtil;
|
||||
@ -88,12 +89,18 @@ public class DragonfireArrowsEnchant extends AbstractEnchantmentData implements
|
||||
return chanceSettings;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.BOW;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.BOWS;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.BOW;
|
||||
// }
|
||||
|
||||
public int getFireDuration(int level) {
|
||||
return (int) this.fireDuration.getValue(level);
|
||||
}
|
||||
|
@ -4,7 +4,6 @@ import org.bukkit.Location;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Projectile;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
@ -14,6 +13,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ArrowData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ArrowSettings;
|
||||
@ -23,6 +23,7 @@ import su.nightexpress.excellentenchants.api.enchantment.type.BowEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ArrowSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.ConfigValue;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.LocationUtil;
|
||||
@ -90,11 +91,17 @@ public class ElectrifiedArrowsEnchant extends AbstractEnchantmentData implements
|
||||
return this.damageModifier.getValue(level);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.BOW;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.BOWS;
|
||||
}
|
||||
//
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.BOW;
|
||||
// }
|
||||
|
||||
private void summonLightning(@NotNull Block block) {
|
||||
Location location = block.getLocation();
|
||||
|
@ -1,7 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.bow;
|
||||
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.EnderPearl;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Projectile;
|
||||
@ -12,12 +11,14 @@ import org.bukkit.event.entity.ProjectileHitEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.BowEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
|
||||
import java.io.File;
|
||||
@ -59,10 +60,16 @@ public class EnderBowEnchant extends AbstractEnchantmentData implements ChanceDa
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.BOW;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.BOWS;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.BOW;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getShootPriority() {
|
||||
|
@ -2,7 +2,6 @@ package su.nightexpress.excellentenchants.enchantment.impl.bow;
|
||||
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.*;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -14,6 +13,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ArrowData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ArrowSettings;
|
||||
@ -23,6 +23,7 @@ import su.nightexpress.excellentenchants.api.enchantment.type.BowEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ArrowSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.ConfigValue;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.manager.SimpeListener;
|
||||
@ -31,7 +32,8 @@ import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_RADIUS;
|
||||
|
||||
public class ExplosiveArrowsEnchant extends AbstractEnchantmentData implements ChanceData, ArrowData, BowEnchant, SimpeListener {
|
||||
|
||||
@ -92,12 +94,18 @@ public class ExplosiveArrowsEnchant extends AbstractEnchantmentData implements C
|
||||
return chanceSettings;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.BOW;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.BOWS;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.BOW;
|
||||
// }
|
||||
|
||||
public final double getExplosionSize(int level) {
|
||||
return this.explosionSize.getValue(level);
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ import org.bukkit.Particle;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.data.Directional;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -19,6 +18,7 @@ import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ArrowData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ArrowSettings;
|
||||
@ -28,12 +28,13 @@ import su.nightexpress.excellentenchants.api.enchantment.type.BowEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ArrowSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
|
||||
public class FlareEnchant extends AbstractEnchantmentData implements ChanceData, ArrowData, BowEnchant {
|
||||
|
||||
@ -56,12 +57,18 @@ public class FlareEnchant extends AbstractEnchantmentData implements ChanceData,
|
||||
this.arrowSettings = ArrowSettingsImpl.create(config, UniParticle.of(Particle.FIREWORKS_SPARK));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.BOW;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.BOWS;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.BOW;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getHitPriority() {
|
||||
|
@ -1,7 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.bow;
|
||||
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.Fireball;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Projectile;
|
||||
@ -14,12 +13,14 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.BowEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.util.EnchantUtils;
|
||||
import su.nightexpress.nightcore.config.ConfigValue;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
@ -81,10 +82,16 @@ public class GhastEnchant extends AbstractEnchantmentData implements ChanceData,
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.BOW;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.BOWS;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.BOW;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getShootPriority() {
|
||||
|
@ -1,7 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.bow;
|
||||
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.AbstractArrow;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
@ -14,13 +13,11 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.*;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.BowEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ArrowSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PotionSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.*;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
|
||||
@ -74,12 +71,18 @@ public class HoverEnchant extends AbstractEnchantmentData implements ChanceData,
|
||||
return potionSettings;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.BOW;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.BOWS;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.BOW;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onShoot(@NotNull EntityShootBowEvent event, @NotNull LivingEntity shooter, @NotNull ItemStack bow, int level) {
|
||||
if (!(event.getProjectile() instanceof Arrow arrow)) return false;
|
||||
|
@ -1,7 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.bow;
|
||||
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.AbstractArrow;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
@ -14,13 +13,11 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.*;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.BowEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ArrowSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PotionSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.*;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
|
||||
@ -74,12 +71,18 @@ public class PoisonedArrowsEnchant extends AbstractEnchantmentData implements Ch
|
||||
return potionSettings;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.BOW;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.BOWS;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.BOW;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onShoot(@NotNull EntityShootBowEvent event, @NotNull LivingEntity shooter, @NotNull ItemStack bow, int level) {
|
||||
if (!(event.getProjectile() instanceof Arrow arrow)) return false;
|
||||
|
@ -1,6 +1,5 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.bow;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Projectile;
|
||||
@ -13,18 +12,20 @@ import org.bukkit.util.Vector;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.BowEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.NumberUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_AMOUNT;
|
||||
|
||||
public class SniperEnchant extends AbstractEnchantmentData implements BowEnchant, ChanceData {
|
||||
|
||||
@ -62,12 +63,18 @@ public class SniperEnchant extends AbstractEnchantmentData implements BowEnchant
|
||||
return this.speedModifier.getValue(level);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.BOW;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.BOWS;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.BOW;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getShootPriority() {
|
||||
|
@ -3,7 +3,6 @@ package su.nightexpress.excellentenchants.enchantment.impl.bow;
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Projectile;
|
||||
@ -16,6 +15,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ArrowData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ArrowSettings;
|
||||
@ -25,6 +25,7 @@ import su.nightexpress.excellentenchants.api.enchantment.type.BowEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ArrowSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.EntityUtil;
|
||||
import su.nightexpress.nightcore.util.NumberUtil;
|
||||
@ -32,7 +33,8 @@ import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_AMOUNT;
|
||||
|
||||
public class VampiricArrowsEnchant extends AbstractEnchantmentData implements BowEnchant, ArrowData, ChanceData {
|
||||
|
||||
@ -64,12 +66,18 @@ public class VampiricArrowsEnchant extends AbstractEnchantmentData implements Bo
|
||||
this.addPlaceholder(GENERIC_AMOUNT, level -> NumberUtil.format(this.getHealAmount(level)));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.BOW;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.BOWS;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.BOW;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public ArrowSettings getArrowSettings() {
|
||||
|
@ -1,7 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.bow;
|
||||
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.AbstractArrow;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
@ -14,13 +13,11 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.*;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.BowEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ArrowSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PotionSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.*;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
|
||||
@ -74,12 +71,18 @@ public class WitheredArrowsEnchant extends AbstractEnchantmentData implements Ch
|
||||
return potionSettings;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.BOW;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.BOWS;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.BOW;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onShoot(@NotNull EntityShootBowEvent event, @NotNull LivingEntity shooter, @NotNull ItemStack bow, int level) {
|
||||
if (!(event.getProjectile() instanceof Arrow arrow)) return false;
|
||||
|
@ -1,16 +1,17 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.fishing;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerFishEvent;
|
||||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.FishingEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.util.EnchantUtils;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
|
||||
@ -32,12 +33,18 @@ public class AutoReelEnchant extends AbstractEnchantmentData implements FishingE
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.FISHING_ROD;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.FISHING_ROD;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.FISHING_ROD;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onFishing(@NotNull PlayerFishEvent event, @NotNull ItemStack item, int level) {
|
||||
if (event.getState() != PlayerFishEvent.State.BITE) return false;
|
||||
|
@ -2,7 +2,6 @@ package su.nightexpress.excellentenchants.enchantment.impl.fishing;
|
||||
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.Drowned;
|
||||
import org.bukkit.entity.FishHook;
|
||||
import org.bukkit.event.player.PlayerFishEvent;
|
||||
@ -10,19 +9,21 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.FishingEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniSound;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
|
||||
public class CurseOfDrownedEnchant extends AbstractEnchantmentData implements FishingEnchant, ChanceData {
|
||||
|
||||
@ -48,12 +49,18 @@ public class CurseOfDrownedEnchant extends AbstractEnchantmentData implements Fi
|
||||
return chanceSettings;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.FISHING_ROD;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.FISHING_ROD;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.FISHING_ROD;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean isCurse() {
|
||||
return true;
|
||||
|
@ -1,6 +1,5 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.fishing;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.player.PlayerFishEvent;
|
||||
@ -8,17 +7,19 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.FishingEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
|
||||
public class DoubleCatchEnchant extends AbstractEnchantmentData implements FishingEnchant, ChanceData {
|
||||
|
||||
@ -38,12 +39,18 @@ public class DoubleCatchEnchant extends AbstractEnchantmentData implements Fishi
|
||||
this.chanceSettings = ChanceSettingsImpl.create(config, Modifier.add(4, 2, 1, 100));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.FISHING_ROD;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.FISHING_ROD;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.FISHING_ROD;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getFishingPriority() {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.fishing;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.FishHook;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -10,9 +10,11 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.GenericEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.util.EnchantUtils;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.manager.SimpeListener;
|
||||
@ -41,12 +43,18 @@ public class RiverMasterEnchant extends AbstractEnchantmentData implements Gener
|
||||
);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.FISHING_ROD;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.FISHING_ROD;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.FISHING_ROD;
|
||||
// }
|
||||
|
||||
public double getDistanceMod(int level) {
|
||||
return this.distanceMod.getValue(level);
|
||||
}
|
||||
@ -56,7 +64,7 @@ public class RiverMasterEnchant extends AbstractEnchantmentData implements Gener
|
||||
if (!(event.getEntity() instanceof FishHook hook)) return;
|
||||
if (!(hook.getShooter() instanceof Player player)) return;
|
||||
|
||||
ItemStack rod = EnchantUtils.getFishingRod(player);
|
||||
ItemStack rod = EnchantUtils.getHandItem(player, Material.FISHING_ROD);
|
||||
if (rod == null) return;
|
||||
|
||||
int level = EnchantUtils.getLevel(rod, this.getEnchantment());
|
||||
|
@ -1,20 +1,21 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.fishing;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.event.player.PlayerFishEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.FishingEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.NumberUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_AMOUNT;
|
||||
|
||||
public class SeasonedAnglerEnchant extends AbstractEnchantmentData implements FishingEnchant {
|
||||
|
||||
@ -42,12 +43,18 @@ public class SeasonedAnglerEnchant extends AbstractEnchantmentData implements Fi
|
||||
return (int) this.xpModifier.getValue(level);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.FISHING_ROD;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.FISHING_ROD;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.FISHING_ROD;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onFishing(@NotNull PlayerFishEvent event, @NotNull ItemStack item, int level) {
|
||||
if (event.getState() != PlayerFishEvent.State.CAUGHT_FISH) return false;
|
||||
|
@ -1,6 +1,5 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.fishing;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.player.PlayerFishEvent;
|
||||
@ -8,12 +7,14 @@ import org.bukkit.inventory.CookingRecipe;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.FishingEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
|
||||
import java.io.File;
|
||||
@ -59,12 +60,18 @@ public class SurvivalistEnchant extends AbstractEnchantmentData implements Fishi
|
||||
return chanceSettings;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.FISHING_ROD;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.FISHING_ROD;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.FISHING_ROD;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getFishingPriority() {
|
||||
|
@ -1,7 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.tool;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -15,13 +14,14 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.BlockBreakEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.util.EnchantUtils;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.manager.SimpeListener;
|
||||
@ -89,16 +89,28 @@ public class BlastMiningEnchant extends AbstractEnchantmentData implements Chanc
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ItemCategory[] getItemCategories() {
|
||||
return new ItemCategory[]{ItemCategory.PICKAXE};
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.TOOL;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.TOOL;
|
||||
public ItemsCategory getPrimaryItems() {
|
||||
return ItemCategories.PICKAXE;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public ItemCategory[] getItemCategories() {
|
||||
// return new ItemCategory[]{ItemCategory.PICKAXE};
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.TOOL;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onBreak(@NotNull BlockBreakEvent event, @NotNull LivingEntity entity, @NotNull ItemStack item, int level) {
|
||||
if (!(entity instanceof Player player)) return false;
|
||||
|
@ -1,6 +1,5 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.tool;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -9,12 +8,14 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.GenericEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.util.EnchantUtils;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.manager.SimpeListener;
|
||||
@ -22,7 +23,8 @@ import su.nightexpress.nightcore.util.NumberUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_AMOUNT;
|
||||
|
||||
public class CurseOfBreakingEnchant extends AbstractEnchantmentData implements GenericEnchant, SimpeListener, ChanceData {
|
||||
|
||||
@ -64,12 +66,18 @@ public class CurseOfBreakingEnchant extends AbstractEnchantmentData implements G
|
||||
return (int) this.durabilityAmount.getValue(level);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.BREAKABLE;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.BREAKABLE;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.BREAKABLE;
|
||||
// }
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||
public void onItemDurability(PlayerItemDamageEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
|
@ -1,6 +1,5 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.tool;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -10,8 +9,8 @@ import org.bukkit.event.entity.EntityResurrectEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemCategory;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
@ -19,13 +18,14 @@ import su.nightexpress.excellentenchants.api.enchantment.type.BlockDropEnchant;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.DeathEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.util.EnchantUtils;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.ItemUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
|
||||
public class CurseOfMediocrityEnchant extends AbstractEnchantmentData implements ChanceData, BlockDropEnchant, DeathEnchant {
|
||||
|
||||
@ -45,20 +45,32 @@ public class CurseOfMediocrityEnchant extends AbstractEnchantmentData implements
|
||||
this.chanceSettings = ChanceSettingsImpl.create(config, Modifier.multiply(15, 1, 1, 100));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.BREAKABLE;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.BREAKABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ItemCategory[] getItemCategories() {
|
||||
return new ItemCategory[] {
|
||||
ItemCategory.SWORD, ItemCategory.BOW, ItemCategory.CROSSBOW, ItemCategory.TRIDENT, ItemCategory.TOOL
|
||||
};
|
||||
public ItemsCategory getPrimaryItems() {
|
||||
return ItemCategories.ALL_RANGE_WEAPON;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.BREAKABLE;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public ItemCategory[] getItemCategories() {
|
||||
// return new ItemCategory[] {
|
||||
// ItemCategory.SWORD, ItemCategory.BOW, ItemCategory.CROSSBOW, ItemCategory.TRIDENT, ItemCategory.TOOL
|
||||
// };
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getDropPriority() {
|
||||
|
@ -1,7 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.tool;
|
||||
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -11,8 +10,8 @@ import org.bukkit.event.entity.EntityResurrectEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemCategory;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
@ -20,12 +19,13 @@ import su.nightexpress.excellentenchants.api.enchantment.type.BlockBreakEnchant;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.DeathEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.ConfigValue;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
|
||||
public class CurseOfMisfortuneEnchant extends AbstractEnchantmentData implements ChanceData, BlockBreakEnchant, DeathEnchant {
|
||||
|
||||
@ -67,18 +67,30 @@ public class CurseOfMisfortuneEnchant extends AbstractEnchantmentData implements
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ItemCategory[] getItemCategories() {
|
||||
return new ItemCategory[] {
|
||||
ItemCategory.SWORD, ItemCategory.BOW, ItemCategory.CROSSBOW, ItemCategory.TRIDENT, ItemCategory.TOOL
|
||||
};
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.BREAKABLE;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.BREAKABLE;
|
||||
@NotNull
|
||||
public ItemsCategory getPrimaryItems() {
|
||||
return ItemCategories.ALL_RANGE_WEAPON;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public ItemCategory[] getItemCategories() {
|
||||
// return new ItemCategory[] {
|
||||
// ItemCategory.SWORD, ItemCategory.BOW, ItemCategory.CROSSBOW, ItemCategory.TRIDENT, ItemCategory.TOOL
|
||||
// };
|
||||
// }
|
||||
//
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.BREAKABLE;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getBreakPriority() {
|
||||
|
@ -1,24 +1,26 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.tool;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PeriodicSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PotionData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PotionSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.PassiveEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PeriodSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PotionSettingsImpl;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_POTION_LEVEL;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_POTION_TYPE;
|
||||
|
||||
public class HasteEnchant extends AbstractEnchantmentData implements PotionData, PassiveEnchant {
|
||||
|
||||
@ -54,10 +56,16 @@ public class HasteEnchant extends AbstractEnchantmentData implements PotionData,
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.TOOL;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.TOOL;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.TOOL;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onTrigger(@NotNull LivingEntity entity, @NotNull ItemStack item, int level) {
|
||||
return this.addEffect(entity, level);
|
||||
|
@ -1,25 +1,26 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.tool;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemCategory;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.BlockBreakEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.NumberUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_AMOUNT;
|
||||
|
||||
public class LuckyMinerEnchant extends AbstractEnchantmentData implements ChanceData, BlockBreakEnchant {
|
||||
|
||||
@ -59,16 +60,28 @@ public class LuckyMinerEnchant extends AbstractEnchantmentData implements Chance
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ItemCategory[] getItemCategories() {
|
||||
return new ItemCategory[]{ItemCategory.PICKAXE};
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.TOOL;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.TOOL;
|
||||
public ItemsCategory getPrimaryItems() {
|
||||
return ItemCategories.PICKAXE;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public ItemCategory[] getItemCategories() {
|
||||
// return new ItemCategory[]{ItemCategory.PICKAXE};
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.TOOL;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onBreak(@NotNull BlockBreakEvent event, @NotNull LivingEntity player, @NotNull ItemStack item, int level) {
|
||||
if (!this.checkTriggerChance(level)) return false;
|
||||
|
@ -6,7 +6,6 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.data.Ageable;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -17,7 +16,7 @@ import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
@ -25,6 +24,7 @@ import su.nightexpress.excellentenchants.api.enchantment.type.BlockBreakEnchant;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.InteractEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.ConfigValue;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniSound;
|
||||
@ -100,16 +100,28 @@ public class ReplanterEnchant extends AbstractEnchantmentData implements ChanceD
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ItemCategory[] getItemCategories() {
|
||||
return new ItemCategory[]{ItemCategory.HOE};
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.TOOL;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.TOOL;
|
||||
public ItemsCategory getPrimaryItems() {
|
||||
return ItemCategories.HOE;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public ItemCategory[] getItemCategories() {
|
||||
// return new ItemCategory[]{ItemCategory.HOE};
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.TOOL;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getInteractPriority() {
|
||||
|
@ -4,7 +4,6 @@ import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.Chest;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -22,10 +21,11 @@ import org.bukkit.inventory.meta.BlockStateMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.Placeholders;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.BlockDropEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.ConfigValue;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.manager.SimpeListener;
|
||||
@ -80,16 +80,28 @@ public class SilkChestEnchant extends AbstractEnchantmentData implements BlockDr
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ItemCategory[] getItemCategories() {
|
||||
return new ItemCategory[]{ItemCategory.AXE};
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.TOOL;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.TOOL;
|
||||
public ItemsCategory getPrimaryItems() {
|
||||
return ItemCategories.AXE;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public ItemCategory[] getItemCategories() {
|
||||
// return new ItemCategory[]{ItemCategory.AXE};
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.TOOL;
|
||||
// }
|
||||
|
||||
public boolean isSilkChest(@NotNull ItemStack item) {
|
||||
return PDCUtil.getBoolean(item, this.keyChest).isPresent();
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ import org.bukkit.Particle;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -20,7 +19,7 @@ import org.bukkit.inventory.meta.BlockStateMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
@ -28,6 +27,7 @@ import su.nightexpress.excellentenchants.api.enchantment.type.BlockBreakEnchant;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.BlockDropEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.ConfigValue;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.language.LangAssets;
|
||||
@ -35,11 +35,13 @@ import su.nightexpress.nightcore.manager.SimpeListener;
|
||||
import su.nightexpress.nightcore.util.LocationUtil;
|
||||
import su.nightexpress.nightcore.util.PDCUtil;
|
||||
import su.nightexpress.nightcore.util.Plugins;
|
||||
import su.nightexpress.nightcore.util.text.NightMessage;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_TYPE;
|
||||
import static su.nightexpress.nightcore.util.text.tag.Tags.*;
|
||||
|
||||
public class SilkSpawnerEnchant extends AbstractEnchantmentData implements ChanceData, BlockBreakEnchant, BlockDropEnchant, SimpeListener {
|
||||
@ -91,16 +93,28 @@ public class SilkSpawnerEnchant extends AbstractEnchantmentData implements Chanc
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ItemCategory[] getItemCategories() {
|
||||
return new ItemCategory[]{ItemCategory.PICKAXE};
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.TOOL;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.TOOL;
|
||||
public ItemsCategory getPrimaryItems() {
|
||||
return ItemCategories.PICKAXE;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public ItemCategory[] getItemCategories() {
|
||||
// return new ItemCategory[]{ItemCategory.PICKAXE};
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.TOOL;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
public ItemStack getSpawner(@NotNull CreatureSpawner spawnerBlock) {
|
||||
ItemStack itemSpawner = new ItemStack(Material.SPAWNER);
|
||||
@ -111,7 +125,7 @@ public class SilkSpawnerEnchant extends AbstractEnchantmentData implements Chanc
|
||||
spawnerItem.setSpawnedType(spawnerBlock.getSpawnedType());
|
||||
spawnerItem.update(true);
|
||||
stateItem.setBlockState(spawnerItem);
|
||||
stateItem.setDisplayName(this.spawnerName.replace(GENERIC_TYPE, LangAssets.get(spawnerBlock.getSpawnedType())));
|
||||
stateItem.setDisplayName(NightMessage.asLegacy(this.spawnerName.replace(GENERIC_TYPE, LangAssets.get(spawnerBlock.getSpawnedType()))));
|
||||
itemSpawner.setItemMeta(stateItem);
|
||||
|
||||
PDCUtil.set(itemSpawner, this.spawnerKey, true);
|
||||
|
@ -8,7 +8,6 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.Container;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.block.BlockDropItemEvent;
|
||||
@ -16,14 +15,15 @@ import org.bukkit.inventory.FurnaceRecipe;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemCategory;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.BlockDropEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.ConfigValue;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.BukkitThing;
|
||||
@ -33,9 +33,12 @@ import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniSound;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
|
||||
public class SmelterEnchant extends AbstractEnchantmentData implements ChanceData, BlockDropEnchant {
|
||||
|
||||
@ -107,16 +110,28 @@ public class SmelterEnchant extends AbstractEnchantmentData implements ChanceDat
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ItemCategory[] getItemCategories() {
|
||||
return new ItemCategory[]{ItemCategory.PICKAXE, ItemCategory.AXE, ItemCategory.SHOVEL};
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.TOOL;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.TOOL;
|
||||
public ItemsCategory getPrimaryItems() {
|
||||
return ItemCategories.MINING_TOOLS;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public ItemCategory[] getItemCategories() {
|
||||
// return new ItemCategory[]{ItemCategory.PICKAXE, ItemCategory.AXE, ItemCategory.SHOVEL};
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.TOOL;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onDrop(@NotNull BlockDropItemEvent event, @NotNull LivingEntity entity, @NotNull ItemStack item, int level) {
|
||||
if (this.disableOnCrouch && entity instanceof Player player && player.isSneaking()) return false;
|
||||
|
@ -1,6 +1,5 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.tool;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -8,13 +7,14 @@ import org.bukkit.event.block.BlockDropItemEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.BlockDropEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.Players;
|
||||
|
||||
@ -47,15 +47,21 @@ public class TelekinesisEnchant extends AbstractEnchantmentData implements Chanc
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ItemCategory[] getItemCategories() {
|
||||
return new ItemCategory[]{ItemCategory.TOOL};
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.TOOL;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.TOOL;
|
||||
}
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public ItemCategory[] getItemCategories() {
|
||||
// return new ItemCategory[]{ItemCategory.TOOL};
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.TOOL;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
|
@ -3,17 +3,17 @@ package su.nightexpress.excellentenchants.enchantment.impl.tool;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.BlockBreakEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.util.EnchantUtils;
|
||||
import su.nightexpress.nightcore.config.ConfigValue;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
@ -56,16 +56,28 @@ public class TunnelEnchant extends AbstractEnchantmentData implements BlockBreak
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ItemCategory[] getItemCategories() {
|
||||
return new ItemCategory[]{ItemCategory.PICKAXE, ItemCategory.SHOVEL};
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.TOOL;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.TOOL;
|
||||
public ItemsCategory getPrimaryItems() {
|
||||
return ItemCategories.PICKAXE;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public ItemCategory[] getItemCategories() {
|
||||
// return new ItemCategory[]{ItemCategory.PICKAXE, ItemCategory.SHOVEL};
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.TOOL;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onBreak(@NotNull BlockBreakEvent event, @NotNull LivingEntity entity, @NotNull ItemStack item, int level) {
|
||||
if (!(entity instanceof Player player)) return false;
|
||||
|
@ -4,7 +4,6 @@ import org.bukkit.Material;
|
||||
import org.bukkit.Tag;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
@ -12,10 +11,11 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.BlockBreakEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.util.EnchantUtils;
|
||||
import su.nightexpress.nightcore.config.ConfigValue;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
@ -96,16 +96,28 @@ public class VeinminerEnchant extends AbstractEnchantmentData implements BlockBr
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ItemCategory[] getItemCategories() {
|
||||
return new ItemCategory[]{ItemCategory.PICKAXE};
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.TOOL;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.TOOL;
|
||||
@NotNull
|
||||
public ItemsCategory getPrimaryItems() {
|
||||
return ItemCategories.PICKAXE;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public ItemCategory[] getItemCategories() {
|
||||
// return new ItemCategory[]{ItemCategory.PICKAXE};
|
||||
// }
|
||||
//
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.TOOL;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
private Set<Block> getNearby(@NotNull Block block) {
|
||||
return Stream.of(AREA).map(block::getRelative)
|
||||
|
@ -1,6 +1,5 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.universal;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
@ -12,9 +11,11 @@ import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.GenericEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.util.EnchantUtils;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.manager.SimpeListener;
|
||||
@ -37,12 +38,24 @@ public class CurseOfFragilityEnchant extends AbstractEnchantmentData implements
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.BREAKABLE;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.BREAKABLE;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public ItemsCategory getPrimaryItems() {
|
||||
// return ItemCategories.PICKAXE;
|
||||
// }
|
||||
//
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.BREAKABLE;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean isCurse() {
|
||||
return true;
|
||||
|
@ -1,7 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.universal;
|
||||
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.player.PlayerItemDamageEvent;
|
||||
@ -10,12 +9,14 @@ import org.bukkit.inventory.meta.Damageable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.GenericEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.util.EnchantUtils;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.manager.SimpeListener;
|
||||
@ -24,7 +25,8 @@ import su.nightexpress.nightcore.util.wrapper.UniSound;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_AMOUNT;
|
||||
|
||||
public class RestoreEnchant extends AbstractEnchantmentData implements GenericEnchant, ChanceData, SimpeListener {
|
||||
|
||||
@ -57,12 +59,18 @@ public class RestoreEnchant extends AbstractEnchantmentData implements GenericEn
|
||||
return chanceSettings;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.BREAKABLE;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.BREAKABLE;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.BREAKABLE;
|
||||
// }
|
||||
|
||||
public double getDurabilityRestore(int level) {
|
||||
return this.durabilityRestore.getValue(level);
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ package su.nightexpress.excellentenchants.enchantment.impl.universal;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -11,9 +10,11 @@ import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.GenericEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.util.EnchantUtils;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.manager.SimpeListener;
|
||||
@ -39,12 +40,18 @@ public class SoulboundEnchant extends AbstractEnchantmentData implements Generic
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.BREAKABLE;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.BREAKABLE;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.BREAKABLE;
|
||||
// }
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onDeath(@NotNull PlayerDeathEvent deathEvent) {
|
||||
Player player = deathEvent.getEntity();
|
||||
|
@ -1,7 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.weapon;
|
||||
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
@ -9,9 +8,11 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.ConfigValue;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.Lists;
|
||||
@ -21,7 +22,7 @@ import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
import java.io.File;
|
||||
import java.util.Set;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_DAMAGE;
|
||||
|
||||
public class BaneOfNetherspawnEnchant extends AbstractEnchantmentData implements CombatEnchant {
|
||||
|
||||
@ -64,10 +65,16 @@ public class BaneOfNetherspawnEnchant extends AbstractEnchantmentData implements
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.WEAPON;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.WEAPON;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onAttack(@NotNull EntityDamageByEntityEvent event, @NotNull LivingEntity damager, @NotNull LivingEntity victim, @NotNull ItemStack weapon, int level) {
|
||||
if (!ENTITY_TYPES.contains(victim.getType())) return false;
|
||||
|
@ -1,7 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.weapon;
|
||||
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
@ -10,6 +9,7 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
@ -18,6 +18,7 @@ import su.nightexpress.excellentenchants.api.enchantment.data.PotionSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PotionSettingsImpl;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
@ -61,12 +62,18 @@ public class BlindnessEnchant extends AbstractEnchantmentData implements ChanceD
|
||||
return potionSettings;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.WEAPON;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.WEAPON;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getAttackPriority() {
|
||||
|
@ -1,7 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.weapon;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
@ -10,6 +9,7 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
@ -18,6 +18,7 @@ import su.nightexpress.excellentenchants.api.enchantment.data.PotionSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PotionSettingsImpl;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
@ -61,12 +62,18 @@ public class ConfusionEnchant extends AbstractEnchantmentData implements ChanceD
|
||||
return potionSettings;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.WEAPON;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.WEAPON;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getAttackPriority() {
|
||||
|
@ -2,7 +2,6 @@ package su.nightexpress.excellentenchants.enchantment.impl.weapon;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.*;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
@ -10,19 +9,21 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Set;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
|
||||
public class CureEnchant extends AbstractEnchantmentData implements ChanceData, CombatEnchant {
|
||||
|
||||
@ -52,10 +53,16 @@ public class CureEnchant extends AbstractEnchantmentData implements ChanceData,
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.WEAPON;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.WEAPON;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getAttackPriority() {
|
||||
|
@ -1,6 +1,5 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.weapon;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.entity.EntityDeathEvent;
|
||||
@ -9,12 +8,14 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.DeathEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
|
||||
import java.io.File;
|
||||
@ -37,12 +38,18 @@ public class CurseOfDeathEnchant extends AbstractEnchantmentData implements Deat
|
||||
this.chanceSettings = ChanceSettingsImpl.create(config, Modifier.add(0.5, 0.15, 1, 100));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.WEAPON;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.WEAPON;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public ChanceSettings getChanceSettings() {
|
||||
|
@ -1,7 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.weapon;
|
||||
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -14,12 +13,14 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.ConfigValue;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.NumberUtil;
|
||||
@ -29,7 +30,8 @@ import su.nightexpress.nightcore.util.wrapper.UniSound;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_DAMAGE;
|
||||
|
||||
public class CutterEnchant extends AbstractEnchantmentData implements ChanceData, CombatEnchant {
|
||||
|
||||
@ -78,10 +80,16 @@ public class CutterEnchant extends AbstractEnchantmentData implements ChanceData
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.WEAPON;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.WEAPON;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getAttackPriority() {
|
||||
|
@ -4,7 +4,6 @@ package su.nightexpress.excellentenchants.enchantment.impl.weapon;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.block.Skull;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -19,12 +18,14 @@ import org.bukkit.inventory.meta.SkullMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.DeathEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.hook.HookPlugin;
|
||||
import su.nightexpress.excellentenchants.hook.impl.MythicMobsHook;
|
||||
import su.nightexpress.nightcore.config.ConfigValue;
|
||||
@ -41,8 +42,9 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.nightcore.util.text.tag.Tags.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_TYPE;
|
||||
import static su.nightexpress.nightcore.util.text.tag.Tags.LIGHT_YELLOW;
|
||||
|
||||
public class DecapitatorEnchant extends AbstractEnchantmentData implements ChanceData, DeathEnchant {
|
||||
|
||||
@ -172,10 +174,16 @@ public class DecapitatorEnchant extends AbstractEnchantmentData implements Chanc
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.WEAPON;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.WEAPON;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onDeath(@NotNull EntityDeathEvent event, @NotNull LivingEntity entity, ItemStack item, int level) {
|
||||
return false;
|
||||
|
@ -2,7 +2,6 @@ package su.nightexpress.excellentenchants.enchantment.impl.weapon;
|
||||
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
@ -10,19 +9,21 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniSound;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
|
||||
public class DoubleStrikeEnchant extends AbstractEnchantmentData implements ChanceData, CombatEnchant {
|
||||
|
||||
@ -50,10 +51,16 @@ public class DoubleStrikeEnchant extends AbstractEnchantmentData implements Chan
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.WEAPON;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.WEAPON;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getAttackPriority() {
|
||||
|
@ -1,7 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.weapon;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
@ -10,6 +9,7 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
@ -18,6 +18,7 @@ import su.nightexpress.excellentenchants.api.enchantment.data.PotionSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PotionSettingsImpl;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
@ -62,12 +63,18 @@ public class ExhaustEnchant extends AbstractEnchantmentData implements ChanceDat
|
||||
return potionSettings;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.WEAPON;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.WEAPON;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getAttackPriority() {
|
||||
|
@ -3,7 +3,6 @@ package su.nightexpress.excellentenchants.enchantment.impl.weapon;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
@ -12,6 +11,7 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
@ -20,6 +20,7 @@ import su.nightexpress.excellentenchants.api.enchantment.data.PotionSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PotionSettingsImpl;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
@ -65,12 +66,18 @@ public class IceAspectEnchant extends AbstractEnchantmentData implements ChanceD
|
||||
return potionSettings;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.WEAPON;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.WEAPON;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getAttackPriority() {
|
||||
|
@ -1,6 +1,5 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.weapon;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Trident;
|
||||
@ -12,9 +11,11 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.GenericEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.util.EnchantUtils;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.manager.SimpeListener;
|
||||
@ -22,7 +23,7 @@ import su.nightexpress.nightcore.util.NumberUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_TIME;
|
||||
|
||||
public class InfernusEnchant extends AbstractEnchantmentData implements GenericEnchant, SimpeListener {
|
||||
|
||||
@ -52,10 +53,16 @@ public class InfernusEnchant extends AbstractEnchantmentData implements GenericE
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.TRIDENT;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.TRIDENT;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.TRIDENT;
|
||||
// }
|
||||
|
||||
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||
public void onInfernusTridentLaunch(ProjectileLaunchEvent event) {
|
||||
Entity entity = event.getEntity();
|
||||
|
@ -1,6 +1,5 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.weapon;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -9,12 +8,14 @@ import org.bukkit.event.entity.EntityResurrectEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.DeathEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.Players;
|
||||
|
||||
@ -44,11 +45,17 @@ public class NimbleEnchant extends AbstractEnchantmentData implements ChanceData
|
||||
return chanceSettings;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.WEAPON;
|
||||
}
|
||||
//
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.WEAPON;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
|
@ -1,7 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.weapon;
|
||||
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
@ -10,6 +9,7 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
@ -18,6 +18,7 @@ import su.nightexpress.excellentenchants.api.enchantment.data.PotionSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PotionSettingsImpl;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
@ -62,12 +63,18 @@ public class ParalyzeEnchant extends AbstractEnchantmentData implements ChanceDa
|
||||
return potionSettings;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.WEAPON;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.WEAPON;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getAttackPriority() {
|
||||
|
@ -1,7 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.weapon;
|
||||
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
@ -10,6 +9,7 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
@ -18,6 +18,7 @@ import su.nightexpress.excellentenchants.api.enchantment.data.PotionSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PotionSettingsImpl;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
@ -62,12 +63,18 @@ public class RageEnchant extends AbstractEnchantmentData implements ChanceData,
|
||||
return potionSettings;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.WEAPON;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.WEAPON;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getAttackPriority() {
|
||||
|
@ -1,7 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.weapon;
|
||||
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Firework;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
@ -12,19 +11,21 @@ import org.bukkit.inventory.meta.FireworkMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.random.Rnd;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniSound;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
|
||||
public class RocketEnchant extends AbstractEnchantmentData implements ChanceData, CombatEnchant {
|
||||
|
||||
@ -61,10 +62,16 @@ public class RocketEnchant extends AbstractEnchantmentData implements ChanceData
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.WEAPON;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.WEAPON;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getAttackPriority() {
|
||||
|
@ -1,6 +1,5 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.weapon;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -14,12 +13,14 @@ import org.bukkit.loot.LootTables;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.DeathEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.util.EnchantUtils;
|
||||
import su.nightexpress.nightcore.config.ConfigValue;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
@ -27,9 +28,12 @@ import su.nightexpress.nightcore.util.StringUtil;
|
||||
import su.nightexpress.nightcore.util.random.Rnd;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
|
||||
public class ScavengerEnchant extends AbstractEnchantmentData implements ChanceData, DeathEnchant {
|
||||
|
||||
@ -119,10 +123,16 @@ public class ScavengerEnchant extends AbstractEnchantmentData implements ChanceD
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.WEAPON;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.WEAPON;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onKill(@NotNull EntityDeathEvent event, @NotNull LivingEntity entity, @NotNull Player killer, @NotNull ItemStack weapon, int level) {
|
||||
if (this.lootTables.isEmpty()) return false;
|
||||
|
@ -3,7 +3,6 @@ package su.nightexpress.excellentenchants.enchantment.impl.weapon;
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.Registry;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
@ -13,6 +12,7 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
@ -21,6 +21,7 @@ import su.nightexpress.excellentenchants.api.enchantment.data.PotionSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PotionSettingsImpl;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.BukkitThing;
|
||||
@ -30,7 +31,7 @@ import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
|
||||
public class SurpriseEnchant extends AbstractEnchantmentData implements ChanceData, PotionData, CombatEnchant {
|
||||
|
||||
@ -77,12 +78,18 @@ public class SurpriseEnchant extends AbstractEnchantmentData implements ChanceDa
|
||||
return potionSettings;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.WEAPON;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.WEAPON;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getAttackPriority() {
|
||||
|
@ -1,6 +1,5 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.weapon;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
@ -8,18 +7,20 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.NumberUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
|
||||
public class SwiperEnchant extends AbstractEnchantmentData implements CombatEnchant, ChanceData {
|
||||
|
||||
@ -48,12 +49,18 @@ public class SwiperEnchant extends AbstractEnchantmentData implements CombatEnch
|
||||
this.addPlaceholder(PLACEHOLER_XP_AMOUNT, level -> NumberUtil.format(this.getXPAmount(level)));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.WEAPON;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.WEAPON;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public ChanceSettings getChanceSettings() {
|
||||
|
@ -1,23 +1,25 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.weapon;
|
||||
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.EntityUtil;
|
||||
import su.nightexpress.nightcore.util.NumberUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_AMOUNT;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_RADIUS;
|
||||
|
||||
public class TemperEnchant extends AbstractEnchantmentData implements CombatEnchant {
|
||||
|
||||
@ -57,11 +59,17 @@ public class TemperEnchant extends AbstractEnchantmentData implements CombatEnch
|
||||
return this.damageStep.getValue(level);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.WEAPON;
|
||||
}
|
||||
//
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.WEAPON;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onAttack(@NotNull EntityDamageByEntityEvent event, @NotNull LivingEntity damager, @NotNull LivingEntity victim, @NotNull ItemStack weapon, int level) {
|
||||
|
@ -1,7 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.weapon;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -11,12 +10,14 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.DeathEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.util.EnchantUtils;
|
||||
import su.nightexpress.excellentenchants.hook.HookPlugin;
|
||||
import su.nightexpress.excellentenchants.hook.impl.MythicMobsHook;
|
||||
@ -30,8 +31,8 @@ import su.nightexpress.nightcore.util.Version;
|
||||
import java.io.File;
|
||||
import java.util.Set;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
|
||||
public class ThriftyEnchant extends AbstractEnchantmentData implements ChanceData, DeathEnchant {
|
||||
|
||||
@ -96,10 +97,16 @@ public class ThriftyEnchant extends AbstractEnchantmentData implements ChanceDat
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.WEAPON;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.WEAPON;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onKill(@NotNull EntityDeathEvent event, @NotNull LivingEntity entity, @NotNull Player killer, ItemStack weapon, int level) {
|
||||
if (this.ignoredEntityTypes.contains(entity.getType())) return false;
|
||||
|
@ -4,19 +4,20 @@ import org.bukkit.Location;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.ConfigValue;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.LocationUtil;
|
||||
@ -25,7 +26,8 @@ import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_DAMAGE;
|
||||
|
||||
public class ThunderEnchant extends AbstractEnchantmentData implements ChanceData, CombatEnchant {
|
||||
|
||||
@ -75,10 +77,16 @@ public class ThunderEnchant extends AbstractEnchantmentData implements ChanceDat
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.WEAPON;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.WEAPON;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onAttack(@NotNull EntityDamageByEntityEvent event, @NotNull LivingEntity damager, @NotNull LivingEntity victim, @NotNull ItemStack weapon, int level) {
|
||||
if (this.isDuringThunderstormOnly() && !victim.getWorld().isThundering()) return false;
|
||||
|
@ -2,7 +2,6 @@ package su.nightexpress.excellentenchants.enchantment.impl.weapon;
|
||||
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
@ -11,12 +10,14 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.ConfigValue;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.EntityUtil;
|
||||
@ -25,7 +26,8 @@ import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_AMOUNT;
|
||||
|
||||
public class VampireEnchant extends AbstractEnchantmentData implements ChanceData, CombatEnchant {
|
||||
|
||||
@ -74,10 +76,16 @@ public class VampireEnchant extends AbstractEnchantmentData implements ChanceDat
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.WEAPON;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.WEAPON;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getAttackPriority() {
|
||||
|
@ -1,7 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.weapon;
|
||||
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
@ -10,6 +9,7 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
@ -18,6 +18,7 @@ import su.nightexpress.excellentenchants.api.enchantment.data.PotionSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PotionSettingsImpl;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
@ -62,12 +63,18 @@ public class VenomEnchant extends AbstractEnchantmentData implements ChanceData,
|
||||
return potionSettings;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.WEAPON;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.WEAPON;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getAttackPriority() {
|
||||
|
@ -1,7 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.weapon;
|
||||
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.Illager;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
@ -9,9 +8,11 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.ConfigValue;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.NumberUtil;
|
||||
@ -19,7 +20,7 @@ import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_AMOUNT;
|
||||
|
||||
public class VillageDefenderEnchant extends AbstractEnchantmentData implements CombatEnchant {
|
||||
|
||||
@ -59,10 +60,16 @@ public class VillageDefenderEnchant extends AbstractEnchantmentData implements C
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.WEAPON;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.WEAPON;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onAttack(@NotNull EntityDamageByEntityEvent event, @NotNull LivingEntity damager, @NotNull LivingEntity victim, @NotNull ItemStack weapon, int level) {
|
||||
if (!(victim instanceof Illager)) return false;
|
||||
|
@ -1,6 +1,5 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.weapon;
|
||||
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.entity.EntityDeathEvent;
|
||||
@ -9,15 +8,18 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.DeathEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.NumberUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_AMOUNT;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_MODIFIER;
|
||||
|
||||
public class WisdomEnchant extends AbstractEnchantmentData implements DeathEnchant {
|
||||
|
||||
@ -48,10 +50,16 @@ public class WisdomEnchant extends AbstractEnchantmentData implements DeathEncha
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.WEAPON;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @NotNull
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.WEAPON;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onKill(@NotNull EntityDeathEvent event, @NotNull LivingEntity entity, @NotNull Player killer, ItemStack weapon, int level) {
|
||||
double xpModifier = this.getXPModifier(level);
|
||||
|
@ -1,7 +1,6 @@
|
||||
package su.nightexpress.excellentenchants.enchantment.impl.weapon;
|
||||
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
@ -10,6 +9,7 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemsCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
@ -18,6 +18,7 @@ import su.nightexpress.excellentenchants.api.enchantment.data.PotionSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ChanceSettingsImpl;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.ItemCategories;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.PotionSettingsImpl;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
@ -62,12 +63,18 @@ public class WitherEnchant extends AbstractEnchantmentData implements ChanceData
|
||||
return potionSettings;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
@NotNull
|
||||
public ItemsCategory getSupportedItems() {
|
||||
return ItemCategories.WEAPON;
|
||||
}
|
||||
|
||||
// @NotNull
|
||||
// @Override
|
||||
// public EnchantmentTarget getCategory() {
|
||||
// return EnchantmentTarget.WEAPON;
|
||||
// }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public EventPriority getAttackPriority() {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user