v4.0.0 beta
This commit is contained in:
parent
13a40b39fc
commit
51e5a2f48a
|
@ -8,17 +8,15 @@ 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.BookCommand;
|
||||
import su.nightexpress.excellentenchants.command.EnchantCommand;
|
||||
import su.nightexpress.excellentenchants.command.ListCommand;
|
||||
import su.nightexpress.excellentenchants.command.RarityBookCommand;
|
||||
import su.nightexpress.excellentenchants.command.*;
|
||||
import su.nightexpress.excellentenchants.config.Config;
|
||||
import su.nightexpress.excellentenchants.config.Keys;
|
||||
import su.nightexpress.excellentenchants.config.Lang;
|
||||
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.hook.HookId;
|
||||
import su.nightexpress.excellentenchants.hook.HookPlugin;
|
||||
import su.nightexpress.excellentenchants.hook.impl.PlaceholderHook;
|
||||
import su.nightexpress.excellentenchants.hook.impl.ProtocolHook;
|
||||
import su.nightexpress.excellentenchants.nms.EnchantNMS;
|
||||
|
@ -33,7 +31,7 @@ import su.nightexpress.nightcore.config.PluginDetails;
|
|||
import su.nightexpress.nightcore.util.Plugins;
|
||||
import su.nightexpress.nightcore.util.Version;
|
||||
|
||||
public class ExcellentEnchantsPlugin extends NightPlugin {
|
||||
public class EnchantsPlugin extends NightPlugin {
|
||||
|
||||
private EnchantRegistry registry;
|
||||
private EnchantManager enchantManager;
|
||||
|
@ -62,14 +60,14 @@ public class ExcellentEnchantsPlugin extends NightPlugin {
|
|||
return;
|
||||
}
|
||||
|
||||
Keys.loadKeys(this);
|
||||
Config.loadRarityWeights(this.getConfig());
|
||||
|
||||
this.getLangManager().loadEnum(ItemCategory.class);
|
||||
this.getLangManager().loadEnum(EnchantmentTarget.class);
|
||||
this.getLangManager().loadEnum(DistributionWay.class);
|
||||
this.getLangManager().loadEnum(Rarity.class);
|
||||
|
||||
Keys.loadKeys(this);
|
||||
Config.loadRarityWeights(this.getConfig());
|
||||
|
||||
this.registerCommands();
|
||||
|
||||
this.registry.setup();
|
||||
|
@ -78,11 +76,11 @@ public class ExcellentEnchantsPlugin extends NightPlugin {
|
|||
this.enchantManager.setup();
|
||||
|
||||
if (Config.ENCHANTMENTS_DISPLAY_MODE.get() == 2) {
|
||||
if (Plugins.isInstalled(HookId.PROTOCOL_LIB)) {
|
||||
if (Plugins.isInstalled(HookPlugin.PROTOCOL_LIB)) {
|
||||
ProtocolHook.setup(this);
|
||||
}
|
||||
else {
|
||||
this.warn(HookId.PROTOCOL_LIB + " is not installed. Display mode is set to Plain lore.");
|
||||
this.warn(HookPlugin.PROTOCOL_LIB + " is not installed. Display mode is set to Plain lore.");
|
||||
Config.ENCHANTMENTS_DISPLAY_MODE.set(1);
|
||||
}
|
||||
}
|
||||
|
@ -124,6 +122,9 @@ public class ExcellentEnchantsPlugin extends NightPlugin {
|
|||
mainCommand.addChildren(new ListCommand(this));
|
||||
mainCommand.addChildren(new RarityBookCommand(this));
|
||||
mainCommand.addChildren(new ReloadSubCommand(this, Perms.COMMAND_RELOAD));
|
||||
if (Config.ENCHANTMENTS_CHARGES_ENABLED.get()) {
|
||||
mainCommand.addChildren(new GetFuelCommand(this));
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
|
@ -19,12 +19,12 @@ public class Placeholders extends su.nightexpress.nightcore.util.Placeholders {
|
|||
public static final String GENERIC_AMOUNT = "%amount%";
|
||||
public static final String GENERIC_DESCRIPTION = "%description%";
|
||||
public static final String GENERIC_ENCHANT = "%enchant%";
|
||||
public static final String GENERIC_RADIUS = "%radius%";
|
||||
public static final String GENERIC_DURATION = "%duration%";
|
||||
public static final String GENERIC_DAMAGE = "%damage%";
|
||||
public static final String GENERIC_MIN = "%min%";
|
||||
public static final String GENERIC_MAX = "%max%";
|
||||
public static final String GENERIC_TIME = "%time%";
|
||||
public static final String GENERIC_RADIUS = "%radius%";
|
||||
public static final String GENERIC_DURATION = "%duration%";
|
||||
public static final String GENERIC_DAMAGE = "%damage%";
|
||||
public static final String GENERIC_MIN = "%min%";
|
||||
public static final String GENERIC_MAX = "%max%";
|
||||
public static final String GENERIC_TIME = "%time%";
|
||||
|
||||
public static final String ENCHANTMENT_CHANCE = "%enchantment_trigger_chance%";
|
||||
public static final String ENCHANTMENT_INTERVAL = "%enchantment_trigger_interval%";
|
||||
|
|
|
@ -6,8 +6,8 @@ import org.bukkit.enchantments.Enchantment;
|
|||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.Perms;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.config.Perms;
|
||||
import su.nightexpress.excellentenchants.Placeholders;
|
||||
import su.nightexpress.excellentenchants.config.Lang;
|
||||
import su.nightexpress.excellentenchants.enchantment.util.EnchantUtils;
|
||||
|
@ -20,9 +20,9 @@ import su.nightexpress.nightcore.util.random.Rnd;
|
|||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class BookCommand extends AbstractCommand<ExcellentEnchantsPlugin> {
|
||||
public class BookCommand extends AbstractCommand<EnchantsPlugin> {
|
||||
|
||||
public BookCommand(@NotNull ExcellentEnchantsPlugin plugin) {
|
||||
public BookCommand(@NotNull EnchantsPlugin plugin) {
|
||||
super(plugin, new String[]{"book"}, Perms.COMMAND_BOOK);
|
||||
this.setDescription(Lang.COMMAND_BOOK_DESC);
|
||||
this.setUsage(Lang.COMMAND_BOOK_USAGE);
|
||||
|
@ -58,7 +58,7 @@ public class BookCommand extends AbstractCommand<ExcellentEnchantsPlugin> {
|
|||
|
||||
Enchantment enchantment = BukkitThing.getEnchantment(result.getArg(2));
|
||||
if (enchantment == null) {
|
||||
Lang.ERROR_NO_ENCHANT.getMessage().send(sender);
|
||||
Lang.ERROR_INVALID_ENCHANT.getMessage().send(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ import org.bukkit.entity.Player;
|
|||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.Perms;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.config.Perms;
|
||||
import su.nightexpress.excellentenchants.Placeholders;
|
||||
import su.nightexpress.excellentenchants.config.Lang;
|
||||
import su.nightexpress.excellentenchants.enchantment.util.EnchantUtils;
|
||||
|
@ -19,9 +19,9 @@ import su.nightexpress.nightcore.util.random.Rnd;
|
|||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class EnchantCommand extends AbstractCommand<ExcellentEnchantsPlugin> {
|
||||
public class EnchantCommand extends AbstractCommand<EnchantsPlugin> {
|
||||
|
||||
public EnchantCommand(@NotNull ExcellentEnchantsPlugin plugin) {
|
||||
public EnchantCommand(@NotNull EnchantsPlugin plugin) {
|
||||
super(plugin, new String[]{"enchant"}, Perms.COMMAND_ENCHANT);
|
||||
this.setDescription(Lang.COMMAND_ENCHANT_DESC);
|
||||
this.setUsage(Lang.COMMAND_ENCHANT_USAGE);
|
||||
|
@ -54,7 +54,7 @@ public class EnchantCommand extends AbstractCommand<ExcellentEnchantsPlugin> {
|
|||
|
||||
Enchantment enchantment = BukkitThing.getEnchantment(result.getArg(1));
|
||||
if (enchantment == null) {
|
||||
Lang.ERROR_NO_ENCHANT.getMessage().send(sender);
|
||||
Lang.ERROR_INVALID_ENCHANT.getMessage().send(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
package su.nightexpress.excellentenchants.command;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.Placeholders;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.EnchantmentData;
|
||||
import su.nightexpress.excellentenchants.config.Lang;
|
||||
import su.nightexpress.excellentenchants.config.Perms;
|
||||
import su.nightexpress.excellentenchants.enchantment.registry.EnchantRegistry;
|
||||
import su.nightexpress.nightcore.command.CommandResult;
|
||||
import su.nightexpress.nightcore.command.impl.AbstractCommand;
|
||||
import su.nightexpress.nightcore.util.ItemUtil;
|
||||
import su.nightexpress.nightcore.util.Lists;
|
||||
import su.nightexpress.nightcore.util.NumberUtil;
|
||||
import su.nightexpress.nightcore.util.Players;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GetFuelCommand extends AbstractCommand<EnchantsPlugin> {
|
||||
|
||||
public GetFuelCommand(@NotNull EnchantsPlugin plugin) {
|
||||
super(plugin, new String[]{"getfuel"}, Perms.COMMAND_GET_FUEL);
|
||||
this.setDescription(Lang.COMMAND_GET_FUEL_DESC);
|
||||
this.setUsage(Lang.COMMAND_GET_FUEL_USAGE);
|
||||
this.setPlayerOnly(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public List<String> getTab(@NotNull Player player, int arg, @NotNull String[] args) {
|
||||
if (arg == 1) {
|
||||
return EnchantRegistry.getRegistered().stream().filter(EnchantmentData::isChargesEnabled).map(EnchantmentData::getId).toList();
|
||||
}
|
||||
if (arg == 2) {
|
||||
return Lists.newList("1", "8", "16", "32", "64");
|
||||
}
|
||||
return super.getTab(player, arg, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onExecute(@NotNull CommandSender sender, @NotNull CommandResult result) {
|
||||
if (result.length() < 2) {
|
||||
this.errorUsage(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
EnchantmentData data = EnchantRegistry.getById(result.getArg(1));
|
||||
if (data == null) {
|
||||
Lang.ERROR_INVALID_ENCHANT.getMessage().send(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
int amount = result.getInt(2, 1);
|
||||
|
||||
ItemStack fuel = data.getChargesFuel();
|
||||
fuel.setAmount(amount);
|
||||
|
||||
Player player = (Player) sender;
|
||||
Players.addItem(player, fuel);
|
||||
|
||||
Lang.COMMAND_GET_FUEL_DONE.getMessage()
|
||||
.replace(Placeholders.GENERIC_AMOUNT, NumberUtil.format(amount))
|
||||
.replace(Placeholders.GENERIC_NAME, ItemUtil.getItemName(fuel))
|
||||
.send(sender);
|
||||
}
|
||||
}
|
|
@ -3,22 +3,50 @@ package su.nightexpress.excellentenchants.command;
|
|||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.Perms;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.Placeholders;
|
||||
import su.nightexpress.excellentenchants.config.Perms;
|
||||
import su.nightexpress.excellentenchants.config.Lang;
|
||||
import su.nightexpress.nightcore.command.CommandResult;
|
||||
import su.nightexpress.nightcore.command.impl.AbstractCommand;
|
||||
import su.nightexpress.nightcore.util.Players;
|
||||
|
||||
public class ListCommand extends AbstractCommand<ExcellentEnchantsPlugin> {
|
||||
import java.util.List;
|
||||
|
||||
public ListCommand(@NotNull ExcellentEnchantsPlugin plugin) {
|
||||
public class ListCommand extends AbstractCommand<EnchantsPlugin> {
|
||||
|
||||
public ListCommand(@NotNull EnchantsPlugin plugin) {
|
||||
super(plugin, new String[]{"list"}, Perms.COMMAND_LIST);
|
||||
this.setDescription(Lang.COMMAND_LIST_DESC);
|
||||
this.setPlayerOnly(true);
|
||||
this.setDescription(Lang.COMMAND_LIST_USAGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public List<String> getTab(@NotNull Player player, int arg, @NotNull String[] args) {
|
||||
if (arg == 1 && player.hasPermission(Perms.COMMAND_LIST_OTHERS)) {
|
||||
return Players.playerNames(player);
|
||||
}
|
||||
return super.getTab(player, arg, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onExecute(@NotNull CommandSender sender, @NotNull CommandResult result) {
|
||||
plugin.getEnchantManager().openEnchantsMenu((Player) sender);
|
||||
if (result.length() >= 2 && !sender.hasPermission(Perms.COMMAND_LIST_OTHERS)) {
|
||||
this.errorPermission(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = Players.getPlayer(result.getArg(1, sender.getName()));
|
||||
if (player == null) {
|
||||
this.errorPlayer(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
plugin.getEnchantManager().openEnchantsMenu(player);
|
||||
|
||||
if (player != sender) {
|
||||
Lang.COMMAND_LIST_DONE_OTHERS.getMessage().replace(Placeholders.forPlayer(player)).send(sender);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,8 +5,8 @@ import org.bukkit.command.CommandSender;
|
|||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.Perms;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.config.Perms;
|
||||
import su.nightexpress.excellentenchants.Placeholders;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.EnchantmentData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
|
@ -24,9 +24,9 @@ import java.util.Arrays;
|
|||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class RarityBookCommand extends AbstractCommand<ExcellentEnchantsPlugin> {
|
||||
public class RarityBookCommand extends AbstractCommand<EnchantsPlugin> {
|
||||
|
||||
public RarityBookCommand(@NotNull ExcellentEnchantsPlugin plugin) {
|
||||
public RarityBookCommand(@NotNull EnchantsPlugin plugin) {
|
||||
super(plugin, new String[]{"raritybook"}, Perms.COMMAND_RARITY_BOOK);
|
||||
this.setDescription(Lang.COMMAND_RARITY_BOOK_DESC);
|
||||
this.setUsage(Lang.COMMAND_RARITY_BOOK_USAGE);
|
||||
|
@ -69,7 +69,7 @@ public class RarityBookCommand extends AbstractCommand<ExcellentEnchantsPlugin>
|
|||
Set<EnchantmentData> enchants = EnchantRegistry.getByRarity(rarity);
|
||||
EnchantmentData enchantmentData = enchants.isEmpty() ? null : Rnd.get(enchants);
|
||||
if (enchantmentData == null) {
|
||||
Lang.ERROR_NO_ENCHANT.getMessage().send(sender);
|
||||
Lang.ERROR_INVALID_ENCHANT.getMessage().send(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import org.jetbrains.annotations.NotNull;
|
|||
import su.nightexpress.excellentenchants.api.DistributionMode;
|
||||
import su.nightexpress.excellentenchants.api.DistributionWay;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.hook.HookId;
|
||||
import su.nightexpress.excellentenchants.hook.HookPlugin;
|
||||
import su.nightexpress.nightcore.config.ConfigValue;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.NumberUtil;
|
||||
|
@ -141,7 +141,7 @@ public class Config {
|
|||
"Sets how enchantment names and descriptions will be handled on items.",
|
||||
"=".repeat(15) + " AVAILABLE VALUES " + "=".repeat(15),
|
||||
"1 = Plain modification of item's lore (lore changes are real and persistent).",
|
||||
"2 = Packet modification of item's lore (no real changes are made to the items). Requires " + HookId.PROTOCOL_LIB + " to be installed.",
|
||||
"2 = Packet modification of item's lore (no real changes are made to the items). Requires " + HookPlugin.PROTOCOL_LIB + " to be installed.",
|
||||
"",
|
||||
"Plain mode is faster, but may not reflect all changes immediately.",
|
||||
"Packet mode is slower, but instantly reflect all changes. In creative mode, there is a chance for lore duplication."
|
||||
|
|
|
@ -2,7 +2,7 @@ package su.nightexpress.excellentenchants.config;
|
|||
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
|
||||
public class Keys {
|
||||
|
||||
|
@ -12,7 +12,7 @@ public class Keys {
|
|||
|
||||
public static NamespacedKey entitySpawnReason;
|
||||
|
||||
public static void loadKeys(@NotNull ExcellentEnchantsPlugin plugin) {
|
||||
public static void loadKeys(@NotNull EnchantsPlugin plugin) {
|
||||
loreSize = new NamespacedKey(plugin, "lore_size");
|
||||
itemRecharged = new NamespacedKey(plugin, "item.recharged");
|
||||
entitySpawnReason = new NamespacedKey(plugin, "entity.spawn_reason");
|
||||
|
|
|
@ -12,6 +12,23 @@ public class Lang extends CoreLang {
|
|||
public static final LangString COMMAND_LIST_DESC = LangString.of("Command.List.Desc",
|
||||
"List of all custom enchantments.");
|
||||
|
||||
public static final LangString COMMAND_LIST_USAGE = LangString.of("Command.List.Usage",
|
||||
"[player]");
|
||||
|
||||
public static final LangText COMMAND_LIST_DONE_OTHERS = LangText.of("Command.List.DoneOthers",
|
||||
LIGHT_GRAY.enclose("Opened enchantments GUI for " + LIGHT_YELLOW.enclose(PLAYER_NAME) + "."));
|
||||
|
||||
|
||||
public static final LangString COMMAND_GET_FUEL_DESC = LangString.of("Command.GetFuel.Desc",
|
||||
"Get enchantment fuel item.");
|
||||
|
||||
public static final LangString COMMAND_GET_FUEL_USAGE = LangString.of("Command.GetFuel.Usage",
|
||||
"<enchant> [amount]");
|
||||
|
||||
public static final LangText COMMAND_GET_FUEL_DONE = LangText.of("Command.GetFuel.Done",
|
||||
LIGHT_GRAY.enclose("You got " + LIGHT_YELLOW.enclose("x" + GENERIC_AMOUNT + " " + GENERIC_NAME) + "."));
|
||||
|
||||
|
||||
public static final LangString COMMAND_ENCHANT_USAGE = LangString.of("Command.Enchant.Usage",
|
||||
"<enchant> <level> [player] [slot]");
|
||||
|
||||
|
@ -27,6 +44,7 @@ public class Lang extends CoreLang {
|
|||
public static final LangText COMMAND_ENCHANT_ERROR_NO_ITEM = LangText.of("Command.Enchant.Error.NoItem",
|
||||
RED.enclose("There is no item to enchant!"));
|
||||
|
||||
|
||||
public static final LangString COMMAND_BOOK_USAGE = LangString.of("Command.Book.Usage",
|
||||
"<player> <enchant> <level>");
|
||||
|
||||
|
@ -36,6 +54,7 @@ public class Lang extends CoreLang {
|
|||
public static final LangText COMMAND_BOOK_DONE = LangText.of("Command.Book.Done",
|
||||
LIGHT_GRAY.enclose("Given " + LIGHT_YELLOW.enclose(GENERIC_ENCHANT) + " enchanted book to " + LIGHT_YELLOW.enclose(PLAYER_DISPLAY_NAME) + "."));
|
||||
|
||||
|
||||
public static final LangString COMMAND_RARITY_BOOK_USAGE = LangString.of("Command.RarityBook.Usage",
|
||||
"<player> <tier> <level>");
|
||||
|
||||
|
@ -45,7 +64,8 @@ public class Lang extends CoreLang {
|
|||
public static final LangText COMMAND_RARITY_BOOK_DONE = LangText.of("Command.RarityBook.Done",
|
||||
LIGHT_GRAY.enclose("Given " + LIGHT_YELLOW.enclose(GENERIC_NAME) + " enchanted book to " + LIGHT_YELLOW.enclose(PLAYER_DISPLAY_NAME) + "."));
|
||||
|
||||
public static final LangText ERROR_NO_ENCHANT = LangText.of("Error.NoEnchant",
|
||||
|
||||
public static final LangText ERROR_INVALID_ENCHANT = LangText.of("Error.InvalidEnchantment",
|
||||
RED.enclose("Invalid enchantment."));
|
||||
|
||||
public static final LangText ERROR_INVALID_RARITY = LangText.of("Error.InvalidRarity",
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package su.nightexpress.excellentenchants;
|
||||
package su.nightexpress.excellentenchants.config;
|
||||
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
import su.nightexpress.excellentenchants.Placeholders;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniPermission;
|
||||
|
||||
public class Perms {
|
||||
|
@ -13,7 +14,9 @@ public class Perms {
|
|||
|
||||
public static final UniPermission COMMAND_BOOK = new UniPermission(PREFIX_COMMAND + "book");
|
||||
public static final UniPermission COMMAND_ENCHANT = new UniPermission(PREFIX_COMMAND + "enchant");
|
||||
public static final UniPermission COMMAND_LIST = new UniPermission(PREFIX_COMMAND + "list", "Allows to use '/eenchants list' command.", PermissionDefault.TRUE);
|
||||
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_RARITY_BOOK = new UniPermission(PREFIX_COMMAND + "raritybook");
|
||||
public static final UniPermission COMMAND_RELOAD = new UniPermission(PREFIX_COMMAND + "reload");
|
||||
|
||||
|
@ -23,7 +26,8 @@ public class Perms {
|
|||
COMMAND.addChildren(
|
||||
COMMAND_BOOK,
|
||||
COMMAND_ENCHANT,
|
||||
COMMAND_LIST,
|
||||
COMMAND_GET_FUEL,
|
||||
COMMAND_LIST, COMMAND_LIST_OTHERS,
|
||||
COMMAND_RELOAD,
|
||||
COMMAND_RARITY_BOOK
|
||||
);
|
|
@ -3,7 +3,7 @@ package su.nightexpress.excellentenchants.enchantment;
|
|||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.EnchantmentData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.PassiveEnchant;
|
||||
import su.nightexpress.excellentenchants.config.Config;
|
||||
|
@ -19,13 +19,13 @@ import su.nightexpress.nightcore.util.Pair;
|
|||
|
||||
import java.util.*;
|
||||
|
||||
public class EnchantManager extends AbstractManager<ExcellentEnchantsPlugin> {
|
||||
public class EnchantManager extends AbstractManager<EnchantsPlugin> {
|
||||
|
||||
private final Set<Pair<PassiveEnchant, EnchantmentData>> passiveEnchants;
|
||||
|
||||
private EnchantmentsListMenu enchantmentsListMenu;
|
||||
|
||||
public EnchantManager(@NotNull ExcellentEnchantsPlugin plugin) {
|
||||
public EnchantManager(@NotNull EnchantsPlugin plugin) {
|
||||
super(plugin);
|
||||
this.passiveEnchants = new HashSet<>();
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import org.bukkit.enchantments.Enchantment;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.DistributionWay;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.EnchantmentData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
|
@ -37,7 +37,7 @@ public class EnchantPopulator {
|
|||
private World world;
|
||||
private BiFunction<EnchantmentData, CustomDistribution, Integer> levelGenerator;
|
||||
|
||||
public EnchantPopulator(@NotNull ExcellentEnchantsPlugin plugin, @NotNull ItemStack item, @NotNull DistributionWay distributionWay) {
|
||||
public EnchantPopulator(@NotNull EnchantsPlugin plugin, @NotNull ItemStack item, @NotNull DistributionWay distributionWay) {
|
||||
//this.plugin = plugin;
|
||||
this.item = item;
|
||||
this.distributionWay = distributionWay;
|
||||
|
|
|
@ -11,7 +11,7 @@ import org.bukkit.inventory.ItemStack;
|
|||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.DistributionWay;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.distribution.DistributionOptions;
|
||||
|
@ -44,7 +44,7 @@ import java.util.stream.Stream;
|
|||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
|
||||
public abstract class AbstractEnchantmentData extends AbstractFileData<ExcellentEnchantsPlugin> implements EnchantmentData {
|
||||
public abstract class AbstractEnchantmentData extends AbstractFileData<EnchantsPlugin> implements EnchantmentData {
|
||||
|
||||
protected Enchantment enchantment;
|
||||
|
||||
|
@ -76,7 +76,7 @@ public abstract class AbstractEnchantmentData extends AbstractFileData<Excellent
|
|||
private final NamespacedKey chargesKey;
|
||||
private final EnchantPlaceholders placeholders;
|
||||
|
||||
public AbstractEnchantmentData(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public AbstractEnchantmentData(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(new ArrayList<>());
|
||||
this.setRarity(Rarity.COMMON);
|
||||
|
|
|
@ -7,7 +7,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -31,7 +31,7 @@ public class ColdSteelEnchant extends AbstractEnchantmentData implements ChanceD
|
|||
private ChanceSettingsImpl chanceSettings;
|
||||
private PotionSettingsImpl potionSettings;
|
||||
|
||||
public ColdSteelEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public ColdSteelEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to apply " + ENCHANTMENT_POTION_TYPE + " " + ENCHANTMENT_POTION_LEVEL + " (" + ENCHANTMENT_POTION_DURATION + "s.) on attacker.");
|
||||
this.setRarity(Rarity.COMMON);
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -33,7 +33,7 @@ public class DarknessCloakEnchant extends AbstractEnchantmentData implements Cha
|
|||
private ChanceSettingsImpl chanceSettings;
|
||||
private PotionSettingsImpl potionSettings;
|
||||
|
||||
public DarknessCloakEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public DarknessCloakEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to apply " + ENCHANTMENT_POTION_TYPE + " " + ENCHANTMENT_POTION_LEVEL + " (" + ENCHANTMENT_POTION_DURATION + "s.) on attacker.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -7,7 +7,7 @@ import org.bukkit.event.EventPriority;
|
|||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.GenericEnchant;
|
||||
|
@ -36,7 +36,7 @@ public class ElementalProtectionEnchant extends AbstractEnchantmentData implemen
|
|||
private double protectionCapacity;
|
||||
private boolean protectionAsModifier;
|
||||
|
||||
public ElementalProtectionEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public ElementalProtectionEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Reduces Poison, Magic, Wither, Lightning, Freeze damage by " + GENERIC_AMOUNT + "%.");
|
||||
this.setMaxLevel(5);
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.bukkit.event.EventPriority;
|
|||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -32,7 +32,7 @@ public class FireShieldEnchant extends AbstractEnchantmentData implements Chance
|
|||
private Modifier fireDuration;
|
||||
private ChanceSettingsImpl chanceSettings;
|
||||
|
||||
public FireShieldEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public FireShieldEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to ignite attackers for " + GENERIC_DURATION + "s.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -18,7 +18,7 @@ import org.bukkit.event.player.PlayerMoveEvent;
|
|||
import org.bukkit.inventory.EntityEquipment;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.GenericEnchant;
|
||||
|
@ -47,7 +47,7 @@ public class FlameWalkerEnchant extends AbstractEnchantmentData implements Gener
|
|||
|
||||
private Modifier blockDecayTime;
|
||||
|
||||
public FlameWalkerEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public FlameWalkerEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Ability to walk on lava, ignore magma block damage.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -7,7 +7,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -31,7 +31,7 @@ public class HardenedEnchant extends AbstractEnchantmentData implements ChanceDa
|
|||
private ChanceSettingsImpl chanceSettings;
|
||||
private PotionSettingsImpl potionSettings;
|
||||
|
||||
public HardenedEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public HardenedEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to get " + ENCHANTMENT_POTION_TYPE + " " + ENCHANTMENT_POTION_LEVEL + " (" + ENCHANTMENT_POTION_DURATION + "s.) when damaged.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -10,7 +10,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -36,7 +36,7 @@ public class IceShieldEnchant extends AbstractEnchantmentData implements ChanceD
|
|||
private ChanceSettingsImpl chanceSettings;
|
||||
private PotionSettingsImpl potionSettings;
|
||||
|
||||
public IceShieldEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public IceShieldEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to freeze and apply " + ENCHANTMENT_POTION_TYPE + " " + ENCHANTMENT_POTION_LEVEL + " (" + ENCHANTMENT_POTION_DURATION + "s.) on attacker.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -5,7 +5,7 @@ import org.bukkit.entity.LivingEntity;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PeriodicSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PotionData;
|
||||
|
@ -27,7 +27,7 @@ public class JumpingEnchant extends AbstractEnchantmentData implements PotionDat
|
|||
private PotionSettingsImpl potionSettings;
|
||||
private PeriodSettingsImpl periodSettings;
|
||||
|
||||
public JumpingEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public JumpingEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setMaxLevel(3);
|
||||
this.setRarity(Rarity.COMMON);
|
||||
|
|
|
@ -13,7 +13,7 @@ import org.bukkit.event.entity.EntityDeathEvent;
|
|||
import org.bukkit.event.entity.EntityResurrectEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -40,7 +40,7 @@ public class KamikadzeEnchant extends AbstractEnchantmentData implements ChanceD
|
|||
|
||||
private Entity exploder;
|
||||
|
||||
public KamikadzeEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public KamikadzeEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to create an explosion on death.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -5,7 +5,7 @@ import org.bukkit.entity.LivingEntity;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PeriodicSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PotionData;
|
||||
|
@ -27,7 +27,7 @@ public class NightVisionEnchant extends AbstractEnchantmentData implements Potio
|
|||
private PotionSettingsImpl potionSettings;
|
||||
private PeriodSettingsImpl periodSettings;
|
||||
|
||||
public NightVisionEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public NightVisionEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Grants permanent " + ENCHANTMENT_POTION_TYPE + " " + ENCHANTMENT_POTION_LEVEL + " effect.");
|
||||
this.setMaxLevel(1);
|
||||
|
|
|
@ -6,7 +6,7 @@ import org.bukkit.enchantments.EnchantmentTarget;
|
|||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -36,7 +36,7 @@ public class RegrowthEnchant extends AbstractEnchantmentData implements ChanceDa
|
|||
private ChanceSettingsImpl chanceSettings;
|
||||
private PeriodSettingsImpl periodSettings;
|
||||
|
||||
public RegrowthEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public RegrowthEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Restores " + GENERIC_AMOUNT + "❤ every few seconds.");
|
||||
this.setMaxLevel(5);
|
||||
|
|
|
@ -5,7 +5,7 @@ import org.bukkit.entity.LivingEntity;
|
|||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PeriodicSettings;
|
||||
|
@ -28,7 +28,7 @@ public class SaturationEnchant extends AbstractEnchantmentData implements Passiv
|
|||
|
||||
private PeriodSettingsImpl periodSettings;
|
||||
|
||||
public SaturationEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public SaturationEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Restores " + GENERIC_AMOUNT + " food points every few seconds.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -5,7 +5,7 @@ import org.bukkit.entity.LivingEntity;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PeriodicSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PotionData;
|
||||
|
@ -27,7 +27,7 @@ public class SpeedyEnchant extends AbstractEnchantmentData implements PotionData
|
|||
private PotionSettingsImpl potionSettings;
|
||||
private PeriodSettingsImpl periodSettings;
|
||||
|
||||
public SpeedyEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public SpeedyEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Grants permanent " + ENCHANTMENT_POTION_TYPE + " " + ENCHANTMENT_POTION_LEVEL + " effect.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -6,7 +6,7 @@ import org.bukkit.event.EventPriority;
|
|||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -28,7 +28,7 @@ public class StoppingForceEnchant extends AbstractEnchantmentData implements Cha
|
|||
private ChanceSettingsImpl chanceSettings;
|
||||
private Modifier knockbackModifier;
|
||||
|
||||
public StoppingForceEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public StoppingForceEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to resist knockback in combat by " + GENERIC_AMOUNT + "%.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -11,7 +11,7 @@ import org.bukkit.inventory.ItemStack;
|
|||
import org.bukkit.loot.LootTable;
|
||||
import org.bukkit.loot.LootTables;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -39,7 +39,7 @@ public class TreasureHunterEnchant extends AbstractEnchantmentData implements Ch
|
|||
|
||||
private final Set<LootTables> lootTables;
|
||||
|
||||
public TreasureHunterEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public TreasureHunterEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to get more items in loot chests.");
|
||||
this.setMaxLevel(4);
|
||||
|
|
|
@ -5,7 +5,7 @@ import org.bukkit.entity.LivingEntity;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PeriodicSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PotionData;
|
||||
|
@ -27,7 +27,7 @@ public class WaterBreathingEnchant extends AbstractEnchantmentData implements Po
|
|||
private PotionSettingsImpl potionSettings;
|
||||
private PeriodSettingsImpl periodSettings;
|
||||
|
||||
public WaterBreathingEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public WaterBreathingEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setMaxLevel(1);
|
||||
this.setRarity(Rarity.UNCOMMON);
|
||||
|
|
|
@ -11,7 +11,7 @@ import org.bukkit.event.entity.EntityShootBowEvent;
|
|||
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -33,7 +33,7 @@ public class BomberEnchant extends AbstractEnchantmentData implements ChanceData
|
|||
private Modifier fuseTicks;
|
||||
private ChanceSettingsImpl chanceSettings;
|
||||
|
||||
public BomberEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public BomberEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to launch TNT that explodes in " + GENERIC_TIME + "s.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.bukkit.event.entity.ProjectileHitEvent;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.*;
|
||||
|
@ -36,7 +36,7 @@ public class ConfusingArrowsEnchant extends AbstractEnchantmentData implements C
|
|||
private ChanceSettingsImpl chanceSettings;
|
||||
private PotionSettingsImpl potionSettings;
|
||||
|
||||
public ConfusingArrowsEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public ConfusingArrowsEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to launch an arrow with " + ENCHANTMENT_POTION_TYPE + " " + ENCHANTMENT_POTION_LEVEL + " (" + ENCHANTMENT_POTION_DURATION + "s.)");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.bukkit.event.entity.ProjectileHitEvent;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.*;
|
||||
|
@ -36,7 +36,7 @@ public class DarknessArrowsEnchant extends AbstractEnchantmentData implements Ch
|
|||
private ChanceSettingsImpl chanceSettings;
|
||||
private PotionSettingsImpl potionSettings;
|
||||
|
||||
public DarknessArrowsEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public DarknessArrowsEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to launch an arrow with " + ENCHANTMENT_POTION_TYPE + " " + ENCHANTMENT_POTION_LEVEL + " (" + ENCHANTMENT_POTION_DURATION + "s.)");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -19,7 +19,7 @@ import org.bukkit.potion.PotionEffectType;
|
|||
import org.bukkit.projectiles.ProjectileSource;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ArrowData;
|
||||
|
@ -50,7 +50,7 @@ public class DragonfireArrowsEnchant extends AbstractEnchantmentData implements
|
|||
private ArrowSettingsImpl arrowSettings;
|
||||
private ChanceSettingsImpl chanceSettings;
|
||||
|
||||
public DragonfireArrowsEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public DragonfireArrowsEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to launch an dragonfire arrow (R=" + GENERIC_RADIUS + ", " + GENERIC_DURATION + "s).");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.bukkit.event.entity.EntityShootBowEvent;
|
|||
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ArrowData;
|
||||
|
@ -43,7 +43,7 @@ public class ElectrifiedArrowsEnchant extends AbstractEnchantmentData implements
|
|||
private Modifier damageModifier;
|
||||
private boolean thunderstormOnly;
|
||||
|
||||
public ElectrifiedArrowsEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public ElectrifiedArrowsEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance for an arrow to strike lightning with " + GENERIC_DAMAGE + "❤ extra damage.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -11,7 +11,7 @@ import org.bukkit.event.entity.EntityShootBowEvent;
|
|||
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
|
@ -28,7 +28,7 @@ public class EnderBowEnchant extends AbstractEnchantmentData implements ChanceDa
|
|||
|
||||
private ChanceSettingsImpl chanceSettings;
|
||||
|
||||
public EnderBowEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public EnderBowEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Shoots ender pearls instead of arrows.");
|
||||
this.setMaxLevel(1);
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.bukkit.event.entity.EntityShootBowEvent;
|
|||
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ArrowData;
|
||||
|
@ -47,7 +47,7 @@ public class ExplosiveArrowsEnchant extends AbstractEnchantmentData implements C
|
|||
|
||||
private Entity lastExploder;
|
||||
|
||||
public ExplosiveArrowsEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public ExplosiveArrowsEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to launch an explosive arrow.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -18,7 +18,7 @@ import org.bukkit.event.entity.ProjectileHitEvent;
|
|||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ArrowData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ArrowSettings;
|
||||
|
@ -42,7 +42,7 @@ public class FlareEnchant extends AbstractEnchantmentData implements ChanceData,
|
|||
private ChanceSettingsImpl chanceSettings;
|
||||
private ArrowSettingsImpl arrowSettings;
|
||||
|
||||
public FlareEnchant(@NotNull ExcellentEnchantsPlugin plugin, File file) {
|
||||
public FlareEnchant(@NotNull EnchantsPlugin plugin, File file) {
|
||||
super(plugin, file);
|
||||
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to create a torch where arrow lands.");
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.bukkit.event.entity.EntityShootBowEvent;
|
|||
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -34,7 +34,7 @@ public class GhastEnchant extends AbstractEnchantmentData implements ChanceData,
|
|||
private Modifier yield;
|
||||
private ChanceSettingsImpl chanceSettings;
|
||||
|
||||
public GhastEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public GhastEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Shoots fireballs instead of arrows.");
|
||||
this.setMaxLevel(1);
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.bukkit.event.entity.ProjectileHitEvent;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.*;
|
||||
|
@ -36,7 +36,7 @@ public class HoverEnchant extends AbstractEnchantmentData implements ChanceData,
|
|||
private ChanceSettingsImpl chanceSettings;
|
||||
private PotionSettingsImpl potionSettings;
|
||||
|
||||
public HoverEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public HoverEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to launch an arrow with " + ENCHANTMENT_POTION_TYPE + " " + ENCHANTMENT_POTION_LEVEL + " (" + ENCHANTMENT_POTION_DURATION + "s.)");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.bukkit.event.entity.ProjectileHitEvent;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.*;
|
||||
|
@ -36,7 +36,7 @@ public class PoisonedArrowsEnchant extends AbstractEnchantmentData implements Ch
|
|||
private ChanceSettingsImpl chanceSettings;
|
||||
private PotionSettingsImpl potionSettings;
|
||||
|
||||
public PoisonedArrowsEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public PoisonedArrowsEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to launch an arrow with " + ENCHANTMENT_POTION_TYPE + " " + ENCHANTMENT_POTION_LEVEL + " (" + ENCHANTMENT_POTION_DURATION + "s.)");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -11,7 +11,7 @@ import org.bukkit.event.entity.ProjectileHitEvent;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.util.Vector;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -33,7 +33,7 @@ public class SniperEnchant extends AbstractEnchantmentData implements BowEnchant
|
|||
private ChanceSettingsImpl chanceSettings;
|
||||
private Modifier speedModifier;
|
||||
|
||||
public SniperEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public SniperEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
|
||||
this.setDescription("Increases projectile speed by " + GENERIC_AMOUNT + "%");
|
||||
|
|
|
@ -14,7 +14,7 @@ import org.bukkit.event.entity.EntityShootBowEvent;
|
|||
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ArrowData;
|
||||
|
@ -42,7 +42,7 @@ public class VampiricArrowsEnchant extends AbstractEnchantmentData implements Bo
|
|||
private ChanceSettingsImpl chanceSettings;
|
||||
private Modifier healAmount;
|
||||
|
||||
public VampiricArrowsEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public VampiricArrowsEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to restore " + GENERIC_AMOUNT + "❤ on arrow hit.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.bukkit.event.entity.ProjectileHitEvent;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.*;
|
||||
|
@ -36,7 +36,7 @@ public class WitheredArrowsEnchant extends AbstractEnchantmentData implements Ch
|
|||
private ChanceSettingsImpl chanceSettings;
|
||||
private PotionSettingsImpl potionSettings;
|
||||
|
||||
public WitheredArrowsEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public WitheredArrowsEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to launch an arrow with " + ENCHANTMENT_POTION_TYPE + " " + ENCHANTMENT_POTION_LEVEL + " (" + ENCHANTMENT_POTION_DURATION + "s.)");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -4,7 +4,7 @@ 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.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.FishingEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
|
@ -16,7 +16,7 @@ public class AutoReelEnchant extends AbstractEnchantmentData implements FishingE
|
|||
|
||||
public static final String ID = "auto_reel";
|
||||
|
||||
public AutoReelEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public AutoReelEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Automatically reels in a hook on bite.");
|
||||
this.setMaxLevel(1);
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.bukkit.entity.FishHook;
|
|||
import org.bukkit.event.player.PlayerFishEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -30,7 +30,7 @@ public class CurseOfDrownedEnchant extends AbstractEnchantmentData implements Fi
|
|||
|
||||
private ChanceSettingsImpl chanceSettings;
|
||||
|
||||
public CurseOfDrownedEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public CurseOfDrownedEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to fish up a Drowned Zombie.");
|
||||
this.setMaxLevel(5);
|
||||
|
|
|
@ -6,7 +6,7 @@ import org.bukkit.event.EventPriority;
|
|||
import org.bukkit.event.player.PlayerFishEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -26,7 +26,7 @@ public class DoubleCatchEnchant extends AbstractEnchantmentData implements Fishi
|
|||
|
||||
private ChanceSettingsImpl chanceSettings;
|
||||
|
||||
public DoubleCatchEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public DoubleCatchEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Increases amount of caught item by x2 with " + ENCHANTMENT_CHANCE + "% chance.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.bukkit.event.EventPriority;
|
|||
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.GenericEnchant;
|
||||
|
@ -25,7 +25,7 @@ public class RiverMasterEnchant extends AbstractEnchantmentData implements Gener
|
|||
|
||||
private Modifier distanceMod;
|
||||
|
||||
public RiverMasterEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public RiverMasterEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Increases casting distance.");
|
||||
this.setMaxLevel(5);
|
||||
|
|
|
@ -4,7 +4,7 @@ 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.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.FishingEnchant;
|
||||
|
@ -22,7 +22,7 @@ public class SeasonedAnglerEnchant extends AbstractEnchantmentData implements Fi
|
|||
|
||||
private Modifier xpModifier;
|
||||
|
||||
public SeasonedAnglerEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public SeasonedAnglerEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Increases amount of XP gained from fishing by " + GENERIC_AMOUNT + "%.");
|
||||
this.setMaxLevel(4);
|
||||
|
|
|
@ -7,7 +7,7 @@ import org.bukkit.event.player.PlayerFishEvent;
|
|||
import org.bukkit.inventory.CookingRecipe;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
|
@ -28,7 +28,7 @@ public class SurvivalistEnchant extends AbstractEnchantmentData implements Fishi
|
|||
|
||||
private ChanceSettingsImpl chanceSettings;
|
||||
|
||||
public SurvivalistEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public SurvivalistEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Automatically cooks fish if what is caught is raw.");
|
||||
this.setMaxLevel(1);
|
||||
|
|
|
@ -13,9 +13,9 @@ import org.bukkit.event.entity.EntityExplodeEvent;
|
|||
import org.bukkit.event.player.PlayerItemDamageEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemCategory;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
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.ChanceSettings;
|
||||
|
@ -23,7 +23,6 @@ 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.util.EnchantUtils;
|
||||
import su.nightexpress.excellentenchants.hook.impl.NoCheatPlusHook;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.manager.SimpeListener;
|
||||
import su.nightexpress.nightcore.util.NumberUtil;
|
||||
|
@ -31,7 +30,8 @@ import su.nightexpress.nightcore.util.NumberUtil;
|
|||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.ENCHANTMENT_CHANCE;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_RADIUS;
|
||||
|
||||
public class BlastMiningEnchant extends AbstractEnchantmentData implements ChanceData, BlockBreakEnchant, SimpeListener {
|
||||
|
||||
|
@ -43,7 +43,7 @@ public class BlastMiningEnchant extends AbstractEnchantmentData implements Chanc
|
|||
|
||||
private int explodeLevel;
|
||||
|
||||
public BlastMiningEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public BlastMiningEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to mine blocks by explosion.");
|
||||
this.setMaxLevel(5);
|
||||
|
@ -111,9 +111,7 @@ public class BlastMiningEnchant extends AbstractEnchantmentData implements Chanc
|
|||
float power = (float) this.getExplosionPower(level);
|
||||
|
||||
this.explodeLevel = level;
|
||||
NoCheatPlusHook.exemptBlocks(player);
|
||||
boolean exploded = block.getWorld().createExplosion(block.getLocation(), power, false, true, player);
|
||||
NoCheatPlusHook.unexemptBlocks(player);
|
||||
this.explodeLevel = -1;
|
||||
|
||||
return exploded;
|
||||
|
|
|
@ -7,7 +7,7 @@ import org.bukkit.event.EventPriority;
|
|||
import org.bukkit.event.player.PlayerItemDamageEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -31,7 +31,7 @@ public class CurseOfBreakingEnchant extends AbstractEnchantmentData implements G
|
|||
private Modifier durabilityAmount;
|
||||
private ChanceSettingsImpl chanceSettings;
|
||||
|
||||
public CurseOfBreakingEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public CurseOfBreakingEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to consume extra " + GENERIC_AMOUNT + " durability points.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -9,7 +9,7 @@ import org.bukkit.event.entity.EntityDeathEvent;
|
|||
import org.bukkit.event.entity.EntityResurrectEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemCategory;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
|
@ -33,7 +33,7 @@ public class CurseOfMediocrityEnchant extends AbstractEnchantmentData implements
|
|||
|
||||
private ChanceSettingsImpl chanceSettings;
|
||||
|
||||
public CurseOfMediocrityEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public CurseOfMediocrityEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to disenchant item drops.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -10,7 +10,7 @@ import org.bukkit.event.entity.EntityDeathEvent;
|
|||
import org.bukkit.event.entity.EntityResurrectEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemCategory;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
|
@ -34,7 +34,7 @@ public class CurseOfMisfortuneEnchant extends AbstractEnchantmentData implements
|
|||
private boolean dropXP;
|
||||
private ChanceSettingsImpl chanceImplementation;
|
||||
|
||||
public CurseOfMisfortuneEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public CurseOfMisfortuneEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to have no drops from blocks or mobs.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -5,7 +5,7 @@ import org.bukkit.entity.LivingEntity;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PeriodicSettings;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.PotionData;
|
||||
|
@ -27,7 +27,7 @@ public class HasteEnchant extends AbstractEnchantmentData implements PotionData,
|
|||
private PotionSettingsImpl potionSettings;
|
||||
private PeriodSettingsImpl periodSettings;
|
||||
|
||||
public HasteEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public HasteEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Grants permanent " + ENCHANTMENT_POTION_TYPE + " " + ENCHANTMENT_POTION_LEVEL + " effect.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -5,7 +5,7 @@ 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.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemCategory;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
|
@ -28,7 +28,7 @@ public class LuckyMinerEnchant extends AbstractEnchantmentData implements Chance
|
|||
private Modifier xpModifier;
|
||||
private ChanceSettingsImpl chanceSettings;
|
||||
|
||||
public LuckyMinerEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public LuckyMinerEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to gain " + GENERIC_AMOUNT + "% more XP from ores.");
|
||||
this.setMaxLevel(5);
|
||||
|
|
|
@ -16,7 +16,7 @@ import org.bukkit.event.player.PlayerInteractEvent;
|
|||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -46,7 +46,7 @@ public class ReplanterEnchant extends AbstractEnchantmentData implements ChanceD
|
|||
Material.MELON_SEEDS, Material.PUMPKIN_SEEDS,
|
||||
Material.POTATO, Material.CARROT, Material.NETHER_WART);
|
||||
|
||||
public ReplanterEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public ReplanterEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Automatically replant crops on right click and when harvest.");
|
||||
this.setMaxLevel(1);
|
||||
|
|
|
@ -20,7 +20,7 @@ import org.bukkit.inventory.Inventory;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.BlockStateMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.Placeholders;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
|
@ -46,7 +46,7 @@ public class SilkChestEnchant extends AbstractEnchantmentData implements BlockDr
|
|||
private List<String> chestLore;
|
||||
private final NamespacedKey keyChest;
|
||||
|
||||
public SilkChestEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public SilkChestEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Drop chests and saves all its content.");
|
||||
this.setMaxLevel(1);
|
||||
|
|
|
@ -18,7 +18,7 @@ import org.bukkit.event.block.BlockPlaceEvent;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.BlockStateMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
|
@ -53,7 +53,7 @@ public class SilkSpawnerEnchant extends AbstractEnchantmentData implements Chanc
|
|||
|
||||
private final NamespacedKey spawnerKey;
|
||||
|
||||
public SilkSpawnerEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public SilkSpawnerEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.spawnerKey = new NamespacedKey(plugin, "divine_spawner");
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import org.bukkit.event.block.BlockDropItemEvent;
|
|||
import org.bukkit.inventory.FurnaceRecipe;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemCategory;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
|
@ -47,7 +47,7 @@ public class SmelterEnchant extends AbstractEnchantmentData implements ChanceDat
|
|||
private final Set<Material> exemptedBlocks;
|
||||
private final Set<FurnaceRecipe> recipes;
|
||||
|
||||
public SmelterEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public SmelterEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Smelts mined blocks with " + ENCHANTMENT_CHANCE + "% chance.");
|
||||
this.setMaxLevel(5);
|
||||
|
|
|
@ -7,7 +7,7 @@ import org.bukkit.event.EventPriority;
|
|||
import org.bukkit.event.block.BlockDropItemEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemCategory;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -27,7 +27,7 @@ public class TelekinesisEnchant extends AbstractEnchantmentData implements Chanc
|
|||
|
||||
private ChanceSettingsImpl chanceSettings;
|
||||
|
||||
public TelekinesisEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public TelekinesisEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Moves all blocks loot directly to your inventory.");
|
||||
this.setMaxLevel(1);
|
||||
|
|
|
@ -9,13 +9,12 @@ 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.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemCategory;
|
||||
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.util.EnchantUtils;
|
||||
import su.nightexpress.excellentenchants.hook.impl.NoCheatPlusHook;
|
||||
import su.nightexpress.nightcore.config.ConfigValue;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
|
||||
|
@ -38,7 +37,7 @@ public class TunnelEnchant extends AbstractEnchantmentData implements BlockBreak
|
|||
|
||||
private boolean disableOnSneak;
|
||||
|
||||
public TunnelEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public TunnelEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
|
||||
this.setDescription("Mines multiple blocks at once in a certain shape.");
|
||||
|
@ -92,8 +91,6 @@ public class TunnelEnchant extends AbstractEnchantmentData implements BlockBreak
|
|||
else if (level == 2) blocksBroken = 5;
|
||||
else if (level >= 3) blocksBroken = 9;
|
||||
|
||||
NoCheatPlusHook.exemptBlocks(player);
|
||||
|
||||
for (int i = 0; i < blocksBroken; i++) {
|
||||
if (item.getType().isAir()) break;
|
||||
|
||||
|
@ -121,8 +118,6 @@ public class TunnelEnchant extends AbstractEnchantmentData implements BlockBreak
|
|||
|
||||
EnchantUtils.safeBusyBreak(player, blockAdd);
|
||||
}
|
||||
|
||||
NoCheatPlusHook.unexemptBlocks(player);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,14 +10,13 @@ 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.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemCategory;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.ItemCategory;
|
||||
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.util.EnchantUtils;
|
||||
import su.nightexpress.excellentenchants.hook.impl.NoCheatPlusHook;
|
||||
import su.nightexpress.nightcore.config.ConfigValue;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.util.BukkitThing;
|
||||
|
@ -28,7 +27,7 @@ import java.util.Set;
|
|||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.excellentenchants.Placeholders.GENERIC_AMOUNT;
|
||||
|
||||
public class VeinminerEnchant extends AbstractEnchantmentData implements BlockBreakEnchant {
|
||||
|
||||
|
@ -43,7 +42,7 @@ public class VeinminerEnchant extends AbstractEnchantmentData implements BlockBr
|
|||
private Set<Material> affectedBlocks;
|
||||
private boolean disableOnCrouch;
|
||||
|
||||
public VeinminerEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public VeinminerEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
|
||||
this.setDescription("Mines up to " + GENERIC_AMOUNT + " blocks of the ore vein at once.");
|
||||
|
@ -140,9 +139,7 @@ public class VeinminerEnchant extends AbstractEnchantmentData implements BlockBr
|
|||
if (block.getDrops(tool, player).isEmpty()) return false;
|
||||
if (!this.getAffectedBlocks().contains(block.getType())) return false;
|
||||
|
||||
NoCheatPlusHook.exemptBlocks(player);
|
||||
this.vein(player, block, level);
|
||||
NoCheatPlusHook.unexemptBlocks(player);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ import org.bukkit.inventory.AnvilInventory;
|
|||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.GenericEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
|
@ -25,7 +25,7 @@ public class CurseOfFragilityEnchant extends AbstractEnchantmentData implements
|
|||
|
||||
public static final String ID = "curse_of_fragility";
|
||||
|
||||
public CurseOfFragilityEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public CurseOfFragilityEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Prevents an item from being grindstoned or anviled.");
|
||||
this.setMaxLevel(1);
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.bukkit.event.player.PlayerItemDamageEvent;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.Damageable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -33,7 +33,7 @@ public class RestoreEnchant extends AbstractEnchantmentData implements GenericEn
|
|||
private ChanceSettingsImpl chanceSettings;
|
||||
private Modifier durabilityRestore;
|
||||
|
||||
public RestoreEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public RestoreEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to save item from breaking back to " + GENERIC_AMOUNT + "%");
|
||||
this.setMaxLevel(5);
|
||||
|
|
|
@ -9,7 +9,7 @@ import org.bukkit.event.EventHandler;
|
|||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.GenericEnchant;
|
||||
import su.nightexpress.excellentenchants.enchantment.data.AbstractEnchantmentData;
|
||||
|
@ -25,7 +25,7 @@ public class SoulboundEnchant extends AbstractEnchantmentData implements Generic
|
|||
|
||||
public static final String ID = "soulbound";
|
||||
|
||||
public SoulboundEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public SoulboundEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Protects from being dropped on death.");
|
||||
this.setMaxLevel(1);
|
||||
|
|
|
@ -7,7 +7,7 @@ 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.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
|
@ -38,7 +38,7 @@ public class BaneOfNetherspawnEnchant extends AbstractEnchantmentData implements
|
|||
private boolean damageModifier;
|
||||
private Modifier damageFormula;
|
||||
|
||||
public BaneOfNetherspawnEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public BaneOfNetherspawnEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Inflicts " + GENERIC_DAMAGE + "❤ more damage to nether mobs.");
|
||||
this.setMaxLevel(5);
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -33,7 +33,7 @@ public class BlindnessEnchant extends AbstractEnchantmentData implements ChanceD
|
|||
private ChanceSettingsImpl chanceSettings;
|
||||
private PotionSettingsImpl potionSettings;
|
||||
|
||||
public BlindnessEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public BlindnessEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to apply " + ENCHANTMENT_POTION_TYPE + " " + ENCHANTMENT_POTION_LEVEL + " (" + ENCHANTMENT_POTION_DURATION + "s.) on hit.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -33,7 +33,7 @@ public class ConfusionEnchant extends AbstractEnchantmentData implements ChanceD
|
|||
private ChanceSettingsImpl chanceSettings;
|
||||
private PotionSettingsImpl potionSettings;
|
||||
|
||||
public ConfusionEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public ConfusionEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to apply " + ENCHANTMENT_POTION_TYPE + " " + ENCHANTMENT_POTION_LEVEL + " (" + ENCHANTMENT_POTION_DURATION + "s.) on hit.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.bukkit.event.EventPriority;
|
|||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -32,7 +32,7 @@ public class CureEnchant extends AbstractEnchantmentData implements ChanceData,
|
|||
|
||||
private static final Set<EntityType> CUREABLE = Sets.newHashSet(EntityType.ZOMBIFIED_PIGLIN, EntityType.ZOMBIE_VILLAGER);
|
||||
|
||||
public CureEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public CureEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to cure Zombified Piglins and Zombie Villagers on hit.");
|
||||
this.setMaxLevel(5);
|
||||
|
|
|
@ -7,7 +7,7 @@ import org.bukkit.event.entity.EntityDeathEvent;
|
|||
import org.bukkit.event.entity.EntityResurrectEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -25,7 +25,7 @@ public class CurseOfDeathEnchant extends AbstractEnchantmentData implements Deat
|
|||
|
||||
private ChanceSettingsImpl chanceSettings;
|
||||
|
||||
public CurseOfDeathEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public CurseOfDeathEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("When killing players, you have a chance of dying too.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.bukkit.inventory.ItemStack;
|
|||
import org.bukkit.inventory.meta.Damageable;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -40,7 +40,7 @@ public class CutterEnchant extends AbstractEnchantmentData implements ChanceData
|
|||
private boolean allowPlayers;
|
||||
private boolean allowMobs;
|
||||
|
||||
public CutterEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public CutterEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to throw away enemy''s armor and damage it for " + GENERIC_DAMAGE + "%.");
|
||||
this.setMaxLevel(5);
|
||||
|
|
|
@ -0,0 +1,280 @@
|
|||
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;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.BlockDropItemEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.entity.EntityDeathEvent;
|
||||
import org.bukkit.event.entity.EntityResurrectEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
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.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.hook.HookPlugin;
|
||||
import su.nightexpress.excellentenchants.hook.impl.MythicMobsHook;
|
||||
import su.nightexpress.nightcore.config.ConfigValue;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.language.LangAssets;
|
||||
import su.nightexpress.nightcore.util.ItemUtil;
|
||||
import su.nightexpress.nightcore.util.PDCUtil;
|
||||
import su.nightexpress.nightcore.util.Plugins;
|
||||
import su.nightexpress.nightcore.util.StringUtil;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
|
||||
import java.io.File;
|
||||
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.*;
|
||||
|
||||
public class DecapitatorEnchant extends AbstractEnchantmentData implements ChanceData, DeathEnchant {
|
||||
|
||||
public static final String ID = "decapitator";
|
||||
|
||||
private boolean ignoreMythicMobs;
|
||||
private Set<EntityType> ignoredEntityTypes;
|
||||
private String headName;
|
||||
private Map<EntityType, String> headTextures;
|
||||
private ChanceSettingsImpl chanceSettings;
|
||||
|
||||
private final NamespacedKey skullKey;
|
||||
|
||||
public DecapitatorEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to obtain player''s or mob''s head.");
|
||||
this.setMaxLevel(4);
|
||||
this.setRarity(Rarity.RARE);
|
||||
|
||||
this.skullKey = new NamespacedKey(plugin, this.getId() + ".entity_type");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadAdditional(@NotNull FileConfig config) {
|
||||
this.chanceSettings = ChanceSettingsImpl.create(config, Modifier.add(5, 1.75, 1, 100));
|
||||
|
||||
this.ignoreMythicMobs = ConfigValue.create("Settings.Ignore_Mythic_Mobs",
|
||||
true,
|
||||
"Sets whether or not MythicMobs should be ignored."
|
||||
).read(config);
|
||||
|
||||
this.ignoredEntityTypes = ConfigValue.forSet("Settings.Ignored_Entity_Types",
|
||||
str -> StringUtil.getEnum(str, EntityType.class).orElse(null),
|
||||
(cfg, path, set) -> cfg.set(path, set.stream().map(Enum::name).toList()),
|
||||
() -> Set.of(
|
||||
EntityType.ENDER_DRAGON, EntityType.WITHER, EntityType.WITHER_SKELETON
|
||||
),
|
||||
"List of entities, that won't drop heads."
|
||||
).read(config);
|
||||
|
||||
this.headName = ConfigValue.create("Settings.Head_Item.Name",
|
||||
LIGHT_YELLOW.enclose(GENERIC_TYPE + "'s Head"),
|
||||
"Head item display name. Use '" + GENERIC_TYPE + "' for entity name.")
|
||||
.read(config);
|
||||
|
||||
this.headTextures = ConfigValue.forMap("Settings.Head_Item.Textures",
|
||||
id -> StringUtil.getEnum(id, EntityType.class).orElse(null),
|
||||
(cfg2, path, id) -> cfg2.getString(path + "." + id),
|
||||
(cfg2, path, map) -> map.forEach((type, txt) -> cfg2.set(path + "." + type.name(), txt)),
|
||||
() -> {
|
||||
Map<EntityType, String> map = new HashMap<>();
|
||||
map.put(EntityType.AXOLOTL, "5c167410409336acc58e6433ffa8b7f86a8786e35ec7300b9062340281d4691c");
|
||||
map.put(EntityType.BAT, "3820a10db222f69ac2215d7d10dca47eeafa215553764a2b81bafd479e7933d1");
|
||||
map.put(EntityType.BEE, "cce9edbbc5fdc0d8487ac72eab239d2cacfe408d74288d6384b044111ba4de0f");
|
||||
map.put(EntityType.BLAZE, "b20657e24b56e1b2f8fc219da1de788c0c24f36388b1a409d0cd2d8dba44aa3b");
|
||||
map.put(EntityType.CAT, "d0dba942c06b77a2828e3f66a1faec5e8643e9ea61a81a4523279739ed82d");
|
||||
map.put(EntityType.CAVE_SPIDER, "eccc4a32d45d74e8b14ef1ffd55cd5f381a06d4999081d52eaea12e13293e209");
|
||||
map.put(EntityType.CHICKEN, "1638469a599ceef7207537603248a9ab11ff591fd378bea4735b346a7fae893");
|
||||
map.put(EntityType.COD, "7892d7dd6aadf35f86da27fb63da4edda211df96d2829f691462a4fb1cab0");
|
||||
map.put(EntityType.COW, "b667c0e107be79d7679bfe89bbc57c6bf198ecb529a3295fcfdfd2f24408dca3");
|
||||
map.put(EntityType.DOLPHIN, "8e9688b950d880b55b7aa2cfcd76e5a0fa94aac6d16f78e833f7443ea29fed3");
|
||||
map.put(EntityType.DONKEY, "63a976c047f412ebc5cb197131ebef30c004c0faf49d8dd4105fca1207edaff3");
|
||||
map.put(EntityType.DROWNED, "c84df79c49104b198cdad6d99fd0d0bcf1531c92d4ab6269e40b7d3cbbb8e98c");
|
||||
map.put(EntityType.ELDER_GUARDIAN, "1c797482a14bfcb877257cb2cff1b6e6a8b8413336ffb4c29a6139278b436b");
|
||||
map.put(EntityType.ENDERMAN, "c09f1de6135f4bea781c5a8e0d61095f833ee2685d8154ecea814ee6d328a5c6");
|
||||
map.put(EntityType.ENDERMITE, "1730127e3ac7677122422df0028d9e7368bd157738c8c3cddecc502e896be01c");
|
||||
map.put(EntityType.EVOKER, "806ac02fd9dac966b7e5806736b6feb90e2f3b0577969e673291b8307c1ef8e5");
|
||||
map.put(EntityType.FOX, "d8954a42e69e0881ae6d24d4281459c144a0d5a968aed35d6d3d73a3c65d26a");
|
||||
map.put(EntityType.GHAST, "64ab8a22e7687cc4c78f3b6ff5b1eb04917b51cd3cd7dbce36171160b3c77ced");
|
||||
map.put(EntityType.GOAT, "457a0d538fa08a7affe312903468861720f9fa34e86d44b89dcec5639265f03");
|
||||
map.put(EntityType.GUARDIAN, "a0bf34a71e7715b6ba52d5dd1bae5cb85f773dc9b0d457b4bfc5f9dd3cc7c94");
|
||||
map.put(EntityType.HOGLIN, "9bb9bc0f01dbd762a08d9e77c08069ed7c95364aa30ca1072208561b730e8d75");
|
||||
map.put(EntityType.HORSE, "a996399fff9cbcfb7ba677dd0c2d104229d1cc2307a6f075a882da4694ef80ae");
|
||||
map.put(EntityType.HUSK, "d674c63c8db5f4ca628d69a3b1f8a36e29d8fd775e1a6bdb6cabb4be4db121");
|
||||
map.put(EntityType.ILLUSIONER, "512512e7d016a2343a7bff1a4cd15357ab851579f1389bd4e3a24cbeb88b");
|
||||
map.put(EntityType.IRON_GOLEM, "a9ceb73d97cf5dc32e333dbef7af25f39e42033d684649075ba4681af2a3c01b");
|
||||
map.put(EntityType.LLAMA, "9f7d90b305aa64313c8d4404d8d652a96eba8a754b67f4347dcccdd5a6a63398");
|
||||
map.put(EntityType.MAGMA_CUBE, "38957d5023c937c4c41aa2412d43410bda23cf79a9f6ab36b76fef2d7c429");
|
||||
map.put(EntityType.MULE, "a0486a742e7dda0bae61ce2f55fa13527f1c3b334c57c034bb4cf132fb5f5f");
|
||||
map.put(EntityType.MUSHROOM_COW, "45603d539f666fdf0f7a0fe20b81dfef3abe6c51da34b9525a5348432c5523b2");
|
||||
map.put(EntityType.OCELOT, "5657cd5c2989ff97570fec4ddcdc6926a68a3393250c1be1f0b114a1db1");
|
||||
map.put(EntityType.PANDA, "8018a1771d69c11b8dad42cd310375ba2d827932b25ef357f7e572c1bd0f9");
|
||||
map.put(EntityType.PARROT, "a4ba8d66fecb1992e94b8687d6ab4a5320ab7594ac194a2615ed4df818edbc3");
|
||||
map.put(EntityType.PHANTOM, "7e95153ec23284b283f00d19d29756f244313a061b70ac03b97d236ee57bd982");
|
||||
map.put(EntityType.PIG, "fa305e321e87ec91421ecccf7cfef10703fb77f62658d6b998f117fcf34cd0b2");
|
||||
map.put(EntityType.PILLAGER, "18e57841607f449e76b7c820fcbd1913ec1b80c4ac81728874db230f5df2b3b");
|
||||
map.put(EntityType.POLAR_BEAR, "d46d23f04846369fa2a3702c10f759101af7bfe8419966429533cd81a11d2b");
|
||||
map.put(EntityType.PUFFERFISH, "6df8c316962949ba3be445c94ebf714108252d46459b66110f4bc14e0e1b59dc");
|
||||
map.put(EntityType.RABBIT, "ffecc6b5e6ea5ced74c46e7627be3f0826327fba26386c6cc7863372e9bc");
|
||||
map.put(EntityType.RAVAGER, "cd20bf52ec390a0799299184fc678bf84cf732bb1bd78fd1c4b441858f0235a8");
|
||||
map.put(EntityType.SALMON, "8aeb21a25e46806ce8537fbd6668281cf176ceafe95af90e94a5fd84924878");
|
||||
map.put(EntityType.SHEEP, "a723893df4cfb9c7240fc47b560ccf6ddeb19da9183d33083f2c71f46dad290a");
|
||||
map.put(EntityType.SILVERFISH, "da91dab8391af5fda54acd2c0b18fbd819b865e1a8f1d623813fa761e924540");
|
||||
map.put(EntityType.SLIME, "a5acd8b24f7389a40404348f4344eec2235d4ca718453be9803b60b71a125891");
|
||||
map.put(EntityType.SNOWMAN, "8e8d206f61e6de8a79d0cb0bcd98aced464cbfefc921b4160a25282163112a");
|
||||
map.put(EntityType.SPIDER, "cd541541daaff50896cd258bdbdd4cf80c3ba816735726078bfe393927e57f1");
|
||||
map.put(EntityType.SQUID, "d8705624daa2956aa45956c81bab5f4fdb2c74a596051e24192039aea3a8b8");
|
||||
map.put(EntityType.STRAY, "9e391c6e535f7aa5a2b6ee6d137f59f2d7c60def88853ba611ceb2d16a7e7c73");
|
||||
map.put(EntityType.STRIDER, "125851a86ee1c54c94fc5bed017823dfb3ba08eddbcab2a914ef45b596c1603");
|
||||
map.put(EntityType.TRADER_LLAMA, "8424780b3c5c5351cf49fb5bf41fcb289491df6c430683c84d7846188db4f84d");
|
||||
map.put(EntityType.TROPICAL_FISH, "d6dd5e6addb56acbc694ea4ba5923b1b25688178feffa72290299e2505c97281");
|
||||
map.put(EntityType.TURTLE, "8fa552139966c5fac1b98061ce23fc0ddef058c163142dd6d1c768cd2da207c2");
|
||||
map.put(EntityType.VEX, "5e7330c7d5cd8a0a55ab9e95321535ac7ae30fe837c37ea9e53bea7ba2de86b");
|
||||
map.put(EntityType.VILLAGER, "a36e9841794a37eb99524925668b47a62b5cb72e096a9f8f95e106804ae13e1b");
|
||||
map.put(EntityType.VINDICATOR, "6deaec344ab095b48cead7527f7dee61b063ff791f76a8fa76642c8676e2173");
|
||||
map.put(EntityType.WANDERING_TRADER, "ee011aac817259f2b48da3e5ef266094703866608b3d7d1754432bf249cd2234");
|
||||
map.put(EntityType.WITCH, "8aa986a6e1c2d88ff198ab2c3259e8d2674cb83a6d206f883bad2c8ada819");
|
||||
map.put(EntityType.WOLF, "28d408842e76a5a454dc1c7e9ac5c1a8ac3f4ad34d6973b5275491dff8c5c251");
|
||||
map.put(EntityType.ZOGLIN, "e67e18602e03035ad68967ce090235d8996663fb9ea47578d3a7ebbc42a5ccf9");
|
||||
map.put(EntityType.ZOMBIFIED_PIGLIN, "7eabaecc5fae5a8a49c8863ff4831aaa284198f1a2398890c765e0a8de18da8c");
|
||||
map.put(EntityType.ZOMBIE_HORSE, "d22950f2d3efddb18de86f8f55ac518dce73f12a6e0f8636d551d8eb480ceec");
|
||||
map.put(EntityType.ZOMBIE_VILLAGER, "b2b393be2dc2973d41a834e19dd6b73b866782d684a097ebfe99cb390194f");
|
||||
map.put(EntityType.SKELETON_HORSE, "47effce35132c86ff72bcae77dfbb1d22587e94df3cbc2570ed17cf8973a");
|
||||
return map;
|
||||
},
|
||||
"Head texture values for each entity type.",
|
||||
"You can take some from http://minecraft-heads.com",
|
||||
"https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/EntityType.html"
|
||||
).read(config);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public ChanceSettings getChanceSettings() {
|
||||
return chanceSettings;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onDeath(@NotNull EntityDeathEvent event, @NotNull LivingEntity entity, ItemStack item, int level) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onResurrect(@NotNull EntityResurrectEvent event, @NotNull LivingEntity entity, @NotNull ItemStack item, int level) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKill(@NotNull EntityDeathEvent event, @NotNull LivingEntity entity, @NotNull Player killer, ItemStack weapon, int level) {
|
||||
EntityType entityType = entity.getType();
|
||||
if (this.ignoredEntityTypes.contains(entityType)) return false;
|
||||
if (this.ignoreMythicMobs && Plugins.isLoaded(HookPlugin.MYTHIC_MOBS) && MythicMobsHook.isMythicMob(entity)) return false;
|
||||
if (!this.checkTriggerChance(level)) return false;
|
||||
|
||||
ItemStack item;
|
||||
if (entityType == EntityType.WITHER_SKELETON || entityType == EntityType.WITHER) {
|
||||
item = new ItemStack(Material.WITHER_SKELETON_SKULL);
|
||||
}
|
||||
else if (entityType == EntityType.ZOMBIE || entityType == EntityType.GIANT) {
|
||||
item = new ItemStack(Material.ZOMBIE_HEAD);
|
||||
}
|
||||
else if (entityType == EntityType.SKELETON) {
|
||||
item = new ItemStack(Material.SKELETON_SKULL);
|
||||
}
|
||||
else if (entityType == EntityType.CREEPER) {
|
||||
item = new ItemStack(Material.CREEPER_HEAD);
|
||||
}
|
||||
else if (entityType == EntityType.ENDER_DRAGON) {
|
||||
item = new ItemStack(Material.DRAGON_HEAD);
|
||||
}
|
||||
else {
|
||||
item = new ItemStack(Material.PLAYER_HEAD);
|
||||
SkullMeta meta = (SkullMeta) item.getItemMeta();
|
||||
if (meta == null) return false;
|
||||
|
||||
String entityName;
|
||||
if (entity instanceof Player player) {
|
||||
entityName = this.headName.replace(GENERIC_TYPE, entity.getName());
|
||||
meta.setOwningPlayer(player);
|
||||
}
|
||||
else {
|
||||
String texture = this.headTextures.get(entity.getType());
|
||||
if (texture == null) return false;
|
||||
|
||||
entityName = this.headName.replace(GENERIC_TYPE, LangAssets.get(entity.getType()));
|
||||
ItemUtil.setHeadSkin(item, texture);
|
||||
meta = (SkullMeta) item.getItemMeta();
|
||||
}
|
||||
|
||||
meta.setDisplayName(entityName);
|
||||
item.setItemMeta(meta);
|
||||
}
|
||||
PDCUtil.set(item, this.skullKey, entityType.name());
|
||||
|
||||
entity.getWorld().dropItemNaturally(entity.getLocation(), item);
|
||||
|
||||
if (this.hasVisualEffects()) {
|
||||
UniParticle.blockCrack(Material.REDSTONE_BLOCK).play(entity.getEyeLocation(), 0.25, 0.15, 30);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onBlockPlace(BlockPlaceEvent event) {
|
||||
if (!(event.getBlock().getState() instanceof Skull skull)) return;
|
||||
|
||||
ItemStack skullItem = event.getItemInHand();
|
||||
PDCUtil.getString(skullItem, this.skullKey).ifPresent(type -> {
|
||||
PDCUtil.set(skull, this.skullKey, type);
|
||||
skull.update(true);
|
||||
});
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onBlockPlace(BlockDropItemEvent event) {
|
||||
if (!(event.getBlockState() instanceof Skull skull)) return;
|
||||
|
||||
PDCUtil.getString(skull, this.skullKey).ifPresent(type -> {
|
||||
EntityType entityType = StringUtil.getEnum(type, EntityType.class).orElse(null);
|
||||
if (entityType == null) return;
|
||||
|
||||
String texture = this.headTextures.get(entityType);
|
||||
if (texture == null) return;
|
||||
|
||||
event.getItems().forEach(item -> {
|
||||
ItemStack drop = item.getItemStack();
|
||||
if (drop.getType() == Material.PLAYER_HEAD) {
|
||||
ItemUtil.setHeadSkin(drop, texture);
|
||||
ItemUtil.editMeta(drop, meta -> {
|
||||
String name = this.headName.replace(GENERIC_TYPE, LangAssets.get(entityType));
|
||||
meta.setDisplayName(name);
|
||||
PDCUtil.set(meta, this.skullKey, type);
|
||||
});
|
||||
}
|
||||
item.setItemStack(drop);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
|
@ -8,7 +8,7 @@ import org.bukkit.event.EventPriority;
|
|||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -30,7 +30,7 @@ public class DoubleStrikeEnchant extends AbstractEnchantmentData implements Chan
|
|||
|
||||
private ChanceSettingsImpl chanceSettings;
|
||||
|
||||
public DoubleStrikeEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public DoubleStrikeEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to inflict double damage.");
|
||||
this.setMaxLevel(4);
|
||||
|
|
|
@ -1,272 +0,0 @@
|
|||
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;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.BlockDropItemEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.entity.EntityDeathEvent;
|
||||
import org.bukkit.event.entity.EntityResurrectEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
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.nightcore.config.ConfigValue;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
import su.nightexpress.nightcore.language.LangAssets;
|
||||
import su.nightexpress.nightcore.util.ItemUtil;
|
||||
import su.nightexpress.nightcore.util.PDCUtil;
|
||||
import su.nightexpress.nightcore.util.StringUtil;
|
||||
import su.nightexpress.nightcore.util.wrapper.UniParticle;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
|
||||
public class EnchantDecapitator extends AbstractEnchantmentData implements ChanceData, DeathEnchant {
|
||||
|
||||
public static final String ID = "decapitator";
|
||||
|
||||
private Set<EntityType> ignoredEntityTypes;
|
||||
private String headName;
|
||||
private Map<EntityType, String> headTextures;
|
||||
private ChanceSettingsImpl chanceSettings;
|
||||
|
||||
private final NamespacedKey skullKey;
|
||||
|
||||
public EnchantDecapitator(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to obtain player''s or mob''s head.");
|
||||
this.setMaxLevel(4);
|
||||
this.setRarity(Rarity.RARE);
|
||||
|
||||
this.skullKey = new NamespacedKey(plugin, this.getId() + ".entity_type");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadAdditional(@NotNull FileConfig config) {
|
||||
this.chanceSettings = ChanceSettingsImpl.create(config, Modifier.add(5, 1.75, 1, 100));
|
||||
|
||||
this.ignoredEntityTypes = ConfigValue.forSet("Settings.Ignored_Entity_Types",
|
||||
str -> StringUtil.getEnum(str, EntityType.class).orElse(null),
|
||||
(cfg, path, set) -> cfg.set(path, set.stream().map(Enum::name).toList()),
|
||||
() -> Set.of(
|
||||
EntityType.BAT, EntityType.BEE, EntityType.ENDER_DRAGON, EntityType.WITHER, EntityType.WITHER_SKELETON
|
||||
),
|
||||
"List of entities, that won't drop heads."
|
||||
).read(config);
|
||||
|
||||
this.headName = ConfigValue.create("Settings.Head_Item.Name",
|
||||
"&c" + GENERIC_TYPE + "'s Head",
|
||||
"Head item display name. Use '" + GENERIC_TYPE + "' for entity name.")
|
||||
.read(config);
|
||||
|
||||
// TODO
|
||||
this.headTextures = ConfigValue.forMap("Settings.Head_Item.Textures",
|
||||
id -> StringUtil.getEnum(id, EntityType.class).orElse(null),
|
||||
(cfg2, path, id) -> cfg2.getString(path + "." + id),
|
||||
(cfg2, path, map) -> map.forEach((type, txt) -> cfg2.set(path + "." + type.name(), txt)),
|
||||
() -> {
|
||||
Map<EntityType, String> map = new HashMap<>();
|
||||
map.put(EntityType.AXOLOTL, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNThkYTFhMGEyYTEzZGQyMDliZmMyNTI5ZDljN2MyOWEyOWRkOWEyM2ZmNGI4MGIzOGI4OTk2MTc3MmU4MDM5ZSJ9fX0=");
|
||||
map.put(EntityType.BAT, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOWU5OWRlZ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dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZTVlMDhhODc3NmMxNzY0YzNmZTZhNmRkZDQxMmRmY2I4N2Y0MTMzMWRhZDQ3OWFjOTZjMjFkZjRiZjNhYzg5YyJ9fX0=");
|
||||
map.put(EntityType.SKELETON_HORSE, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNDdlZmZjZTM1MTMyYzg2ZmY3MmJjYWU3N2RmYmIxZDIyNTg3ZTk0ZGYzY2JjMjU3MGVkMTdjZjg5NzNhIn19fQ==");
|
||||
return map;
|
||||
},
|
||||
"Head texture values for each entity type.",
|
||||
"You can take some from http://minecraft-heads.com",
|
||||
"https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/EntityType.html"
|
||||
).read(config);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public ChanceSettings getChanceSettings() {
|
||||
return chanceSettings;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public EnchantmentTarget getCategory() {
|
||||
return EnchantmentTarget.WEAPON;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onDeath(@NotNull EntityDeathEvent event, @NotNull LivingEntity entity, ItemStack item, int level) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onResurrect(@NotNull EntityResurrectEvent event, @NotNull LivingEntity entity, @NotNull ItemStack item, int level) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKill(@NotNull EntityDeathEvent event, @NotNull LivingEntity entity, @NotNull Player killer, ItemStack weapon, int level) {
|
||||
EntityType entityType = entity.getType();
|
||||
if (this.ignoredEntityTypes.contains(entityType)) return false;
|
||||
if (!this.checkTriggerChance(level)) return false;
|
||||
|
||||
ItemStack item;
|
||||
if (entityType == EntityType.WITHER_SKELETON || entityType == EntityType.WITHER) {
|
||||
item = new ItemStack(Material.WITHER_SKELETON_SKULL);
|
||||
}
|
||||
else if (entityType == EntityType.ZOMBIE || entityType == EntityType.GIANT) {
|
||||
item = new ItemStack(Material.ZOMBIE_HEAD);
|
||||
}
|
||||
else if (entityType == EntityType.SKELETON) {
|
||||
item = new ItemStack(Material.SKELETON_SKULL);
|
||||
}
|
||||
else if (entityType == EntityType.CREEPER) {
|
||||
item = new ItemStack(Material.CREEPER_HEAD);
|
||||
}
|
||||
else if (entityType == EntityType.ENDER_DRAGON) {
|
||||
item = new ItemStack(Material.DRAGON_HEAD);
|
||||
}
|
||||
else {
|
||||
item = new ItemStack(Material.PLAYER_HEAD);
|
||||
SkullMeta meta = (SkullMeta) item.getItemMeta();
|
||||
if (meta == null) return false;
|
||||
|
||||
String entityName;
|
||||
if (entity instanceof Player player) {
|
||||
entityName = this.headName.replace(GENERIC_TYPE, entity.getName());
|
||||
meta.setOwningPlayer(player);
|
||||
}
|
||||
else {
|
||||
String texture = this.headTextures.get(entity.getType());
|
||||
if (texture == null) return false;
|
||||
|
||||
entityName = this.headName.replace(GENERIC_TYPE, LangAssets.get(entity.getType()));
|
||||
ItemUtil.setSkullTexture(item, texture);
|
||||
meta = (SkullMeta) item.getItemMeta();
|
||||
}
|
||||
|
||||
meta.setDisplayName(entityName);
|
||||
item.setItemMeta(meta);
|
||||
}
|
||||
PDCUtil.set(item, this.skullKey, entityType.name());
|
||||
|
||||
entity.getWorld().dropItemNaturally(entity.getLocation(), item);
|
||||
|
||||
if (this.hasVisualEffects()) {
|
||||
UniParticle.blockCrack(Material.REDSTONE_BLOCK).play(entity.getEyeLocation(), 0.25, 0.15, 30);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onBlockPlace(BlockPlaceEvent e) {
|
||||
if (!(e.getBlock().getState() instanceof Skull skull)) return;
|
||||
|
||||
ItemStack skullItem = e.getItemInHand();
|
||||
PDCUtil.getString(skullItem, this.skullKey).ifPresent(type -> {
|
||||
PDCUtil.set(skull, this.skullKey, type);
|
||||
skull.update(true);
|
||||
});
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onBlockPlace(BlockDropItemEvent event) {
|
||||
if (!(event.getBlockState() instanceof Skull skull)) return;
|
||||
|
||||
PDCUtil.getString(skull, this.skullKey).ifPresent(type -> {
|
||||
EntityType entityType = StringUtil.getEnum(type, EntityType.class).orElse(null);
|
||||
if (entityType == null) return;
|
||||
|
||||
String texture = this.headTextures.get(entityType);
|
||||
if (texture == null) return;
|
||||
|
||||
event.getItems().forEach(item -> {
|
||||
ItemStack drop = item.getItemStack();
|
||||
if (drop.getType() == Material.PLAYER_HEAD) {
|
||||
ItemUtil.setSkullTexture(drop, texture);
|
||||
ItemUtil.editMeta(drop, meta -> {
|
||||
String name = this.headName.replace(GENERIC_TYPE, LangAssets.get(entityType));
|
||||
meta.setDisplayName(name);
|
||||
PDCUtil.set(meta, this.skullKey, type);
|
||||
});
|
||||
}
|
||||
item.setItemStack(drop);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
|
@ -8,7 +8,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -33,7 +33,7 @@ public class ExhaustEnchant extends AbstractEnchantmentData implements ChanceDat
|
|||
private ChanceSettingsImpl chanceSettings;
|
||||
private PotionSettingsImpl potionSettings;
|
||||
|
||||
public ExhaustEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public ExhaustEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to apply " + ENCHANTMENT_POTION_TYPE + " " + ENCHANTMENT_POTION_LEVEL + " (" + ENCHANTMENT_POTION_DURATION + "s.) on hit.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -10,7 +10,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -36,7 +36,7 @@ public class IceAspectEnchant extends AbstractEnchantmentData implements ChanceD
|
|||
private ChanceSettingsImpl chanceSettings;
|
||||
private PotionSettingsImpl potionSettings;
|
||||
|
||||
public IceAspectEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public IceAspectEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Freezes and applies " + ENCHANTMENT_POTION_TYPE + " " + ENCHANTMENT_POTION_LEVEL + " (" + ENCHANTMENT_POTION_DURATION + "s.) on hit.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -10,7 +10,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
|||
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.GenericEnchant;
|
||||
|
@ -30,7 +30,7 @@ public class InfernusEnchant extends AbstractEnchantmentData implements GenericE
|
|||
|
||||
private Modifier fireTicks;
|
||||
|
||||
public InfernusEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public InfernusEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Launched trident will ignite the enemy for " + GENERIC_TIME + "s. on hit.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.bukkit.event.entity.EntityDeathEvent;
|
|||
import org.bukkit.event.entity.EntityResurrectEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceSettings;
|
||||
|
@ -26,7 +26,7 @@ public class NimbleEnchant extends AbstractEnchantmentData implements ChanceData
|
|||
|
||||
private ChanceSettingsImpl chanceSettings;
|
||||
|
||||
public NimbleEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public NimbleEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Moves all mob's loot directly to your inventory.");
|
||||
this.setMaxLevel(1);
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -33,7 +33,7 @@ public class ParalyzeEnchant extends AbstractEnchantmentData implements ChanceDa
|
|||
private ChanceSettingsImpl chanceSettings;
|
||||
private PotionSettingsImpl potionSettings;
|
||||
|
||||
public ParalyzeEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public ParalyzeEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to apply " + ENCHANTMENT_POTION_TYPE + " " + ENCHANTMENT_POTION_LEVEL + " (" + ENCHANTMENT_POTION_DURATION + "s.) on hit.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -33,7 +33,7 @@ public class RageEnchant extends AbstractEnchantmentData implements ChanceData,
|
|||
private ChanceSettingsImpl chanceSettings;
|
||||
private PotionSettingsImpl potionSettings;
|
||||
|
||||
public RageEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public RageEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to get " + ENCHANTMENT_POTION_TYPE + " " + ENCHANTMENT_POTION_LEVEL + " (" + ENCHANTMENT_POTION_DURATION + "s.) on hit.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -10,7 +10,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.FireworkMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -33,7 +33,7 @@ public class RocketEnchant extends AbstractEnchantmentData implements ChanceData
|
|||
private Modifier fireworkPower;
|
||||
private ChanceSettingsImpl chanceSettings;
|
||||
|
||||
public RocketEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public RocketEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to launch your enemy into the space.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.bukkit.loot.LootContext;
|
|||
import org.bukkit.loot.LootTable;
|
||||
import org.bukkit.loot.LootTables;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -41,7 +41,7 @@ public class ScavengerEnchant extends AbstractEnchantmentData implements ChanceD
|
|||
|
||||
private ChanceSettingsImpl chanceSettings;
|
||||
|
||||
public ScavengerEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public ScavengerEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to get additional loot from mobs.");
|
||||
this.setMaxLevel(4);
|
||||
|
|
|
@ -11,7 +11,7 @@ import org.bukkit.inventory.ItemStack;
|
|||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -38,7 +38,7 @@ public class SurpriseEnchant extends AbstractEnchantmentData implements ChanceDa
|
|||
private ChanceSettingsImpl chanceSettings;
|
||||
private PotionSettingsImpl potionSettings;
|
||||
|
||||
public SurpriseEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public SurpriseEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to apply random potion effect to enemy on hit.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -6,7 +6,7 @@ import org.bukkit.entity.Player;
|
|||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -30,7 +30,7 @@ public class SwiperEnchant extends AbstractEnchantmentData implements CombatEnch
|
|||
private ChanceSettingsImpl chanceSettings;
|
||||
private Modifier xpAmount;
|
||||
|
||||
public SwiperEnchant(@NotNull ExcellentEnchantsPlugin plugin, File file) {
|
||||
public SwiperEnchant(@NotNull EnchantsPlugin plugin, File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to steal " + PLACEHOLER_XP_AMOUNT + " XP from players.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -6,7 +6,7 @@ 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.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
|
@ -26,7 +26,7 @@ public class TemperEnchant extends AbstractEnchantmentData implements CombatEnch
|
|||
private Modifier damageAmount;
|
||||
private Modifier damageStep;
|
||||
|
||||
public TemperEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public TemperEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Inflicts " + GENERIC_AMOUNT + "% more damage for each " + GENERIC_RADIUS + "❤ missing.");
|
||||
this.setMaxLevel(5);
|
||||
|
|
|
@ -9,7 +9,7 @@ import org.bukkit.event.entity.EntityDeathEvent;
|
|||
import org.bukkit.event.entity.EntityResurrectEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -18,7 +18,7 @@ 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.util.EnchantUtils;
|
||||
import su.nightexpress.excellentenchants.hook.HookId;
|
||||
import su.nightexpress.excellentenchants.hook.HookPlugin;
|
||||
import su.nightexpress.excellentenchants.hook.impl.MythicMobsHook;
|
||||
import su.nightexpress.nightcore.config.ConfigValue;
|
||||
import su.nightexpress.nightcore.config.FileConfig;
|
||||
|
@ -43,7 +43,7 @@ public class ThriftyEnchant extends AbstractEnchantmentData implements ChanceDat
|
|||
|
||||
private ChanceSettingsImpl chanceSettings;
|
||||
|
||||
public ThriftyEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public ThriftyEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance for mobs to drop spawn egg.");
|
||||
this.setMaxLevel(3);
|
||||
|
@ -103,7 +103,7 @@ public class ThriftyEnchant extends AbstractEnchantmentData implements ChanceDat
|
|||
@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;
|
||||
if (this.ignoreMythicMobs && Plugins.isLoaded(HookId.MYTHIC_MOBS) && MythicMobsHook.isMythicMob(entity)) return false;
|
||||
if (this.ignoreMythicMobs && Plugins.isLoaded(HookPlugin.MYTHIC_MOBS) && MythicMobsHook.isMythicMob(entity)) return false;
|
||||
|
||||
SpawnReason spawnReason = EnchantUtils.getSpawnReason(entity);
|
||||
if (spawnReason != null && this.ignoredSpawnReasons.contains(spawnReason)) return false;
|
||||
|
|
|
@ -9,7 +9,7 @@ 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.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -35,7 +35,7 @@ public class ThunderEnchant extends AbstractEnchantmentData implements ChanceDat
|
|||
private ChanceSettingsImpl chanceSettings;
|
||||
private Modifier damageModifier;
|
||||
|
||||
public ThunderEnchant(@NotNull ExcellentEnchantsPlugin plugin, File file) {
|
||||
public ThunderEnchant(@NotNull EnchantsPlugin plugin, File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to strike lightning with " + GENERIC_DAMAGE + "❤ extra damage.");
|
||||
this.setMaxLevel(5);
|
||||
|
|
|
@ -9,7 +9,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
|||
import org.bukkit.event.entity.EntityRegainHealthEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -35,7 +35,7 @@ public class VampireEnchant extends AbstractEnchantmentData implements ChanceDat
|
|||
private boolean healMultiplier;
|
||||
private ChanceSettingsImpl chanceSettings;
|
||||
|
||||
public VampireEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public VampireEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to heal for " + GENERIC_AMOUNT + "❤ on hit.");
|
||||
this.setMaxLevel(4);
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -33,7 +33,7 @@ public class VenomEnchant extends AbstractEnchantmentData implements ChanceData,
|
|||
private ChanceSettingsImpl chanceSettings;
|
||||
private PotionSettingsImpl potionSettings;
|
||||
|
||||
public VenomEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public VenomEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to apply " + ENCHANTMENT_POTION_TYPE + " " + ENCHANTMENT_POTION_LEVEL + " (" + ENCHANTMENT_POTION_DURATION + "s.) on hit.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -7,7 +7,7 @@ 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.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant;
|
||||
|
@ -28,7 +28,7 @@ public class VillageDefenderEnchant extends AbstractEnchantmentData implements C
|
|||
private boolean damageMultiplier;
|
||||
private Modifier damageAmount;
|
||||
|
||||
public VillageDefenderEnchant(@NotNull ExcellentEnchantsPlugin plugin, File file) {
|
||||
public VillageDefenderEnchant(@NotNull EnchantsPlugin plugin, File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Inflicts " + GENERIC_AMOUNT + "❤ more damage to all pillagers.");
|
||||
this.setMaxLevel(5);
|
||||
|
|
|
@ -7,7 +7,7 @@ import org.bukkit.event.entity.EntityDeathEvent;
|
|||
import org.bukkit.event.entity.EntityResurrectEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.DeathEnchant;
|
||||
|
@ -25,7 +25,7 @@ public class WisdomEnchant extends AbstractEnchantmentData implements DeathEncha
|
|||
|
||||
private Modifier xpModifier;
|
||||
|
||||
public WisdomEnchant(@NotNull ExcellentEnchantsPlugin plugin, File file) {
|
||||
public WisdomEnchant(@NotNull EnchantsPlugin plugin, File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription("Increases XP dropped from mobs by " + GENERIC_AMOUNT + "%.");
|
||||
this.setMaxLevel(5);
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.Modifier;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.data.ChanceData;
|
||||
|
@ -33,7 +33,7 @@ public class WitherEnchant extends AbstractEnchantmentData implements ChanceData
|
|||
private ChanceSettingsImpl chanceSettings;
|
||||
private PotionSettingsImpl potionSettings;
|
||||
|
||||
public WitherEnchant(@NotNull ExcellentEnchantsPlugin plugin, @NotNull File file) {
|
||||
public WitherEnchant(@NotNull EnchantsPlugin plugin, @NotNull File file) {
|
||||
super(plugin, file);
|
||||
this.setDescription(ENCHANTMENT_CHANCE + "% chance to apply " + ENCHANTMENT_POTION_TYPE + " " + ENCHANTMENT_POTION_LEVEL + " (" + ENCHANTMENT_POTION_DURATION + "s.) on hit.");
|
||||
this.setMaxLevel(3);
|
||||
|
|
|
@ -11,7 +11,7 @@ import org.bukkit.inventory.AnvilInventory;
|
|||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.EnchantmentData;
|
||||
import su.nightexpress.excellentenchants.config.Keys;
|
||||
import su.nightexpress.excellentenchants.enchantment.util.EnchantUtils;
|
||||
|
@ -22,9 +22,9 @@ import su.nightexpress.nightcore.util.wrapper.UniSound;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class EnchantAnvilListener extends AbstractListener<ExcellentEnchantsPlugin> {
|
||||
public class EnchantAnvilListener extends AbstractListener<EnchantsPlugin> {
|
||||
|
||||
public EnchantAnvilListener(@NotNull ExcellentEnchantsPlugin plugin) {
|
||||
public EnchantAnvilListener(@NotNull EnchantsPlugin plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,18 +16,18 @@ import org.bukkit.event.inventory.InventoryType;
|
|||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.EnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.EnchantManager;
|
||||
import su.nightexpress.excellentenchants.enchantment.registry.EnchantRegistry;
|
||||
import su.nightexpress.excellentenchants.enchantment.util.EnchantUtils;
|
||||
import su.nightexpress.nightcore.manager.AbstractListener;
|
||||
|
||||
public class EnchantGenericListener extends AbstractListener<ExcellentEnchantsPlugin> {
|
||||
public class EnchantGenericListener extends AbstractListener<EnchantsPlugin> {
|
||||
|
||||
//private final EnchantManager enchantManager;
|
||||
|
||||
public EnchantGenericListener(@NotNull ExcellentEnchantsPlugin plugin, @NotNull EnchantManager enchantManager) {
|
||||
public EnchantGenericListener(@NotNull EnchantsPlugin plugin, @NotNull EnchantManager enchantManager) {
|
||||
super(plugin);
|
||||
//this.enchantManager = enchantManager;
|
||||
}
|
||||
|
|
|
@ -12,19 +12,19 @@ import org.bukkit.event.player.PlayerFishEvent;
|
|||
import org.bukkit.event.world.LootGenerateEvent;
|
||||
import org.bukkit.inventory.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.DistributionWay;
|
||||
import su.nightexpress.excellentenchants.config.Config;
|
||||
import su.nightexpress.excellentenchants.enchantment.EnchantPopulator;
|
||||
import su.nightexpress.excellentenchants.enchantment.util.EnchantUtils;
|
||||
import su.nightexpress.excellentenchants.hook.HookId;
|
||||
import su.nightexpress.excellentenchants.hook.HookPlugin;
|
||||
import su.nightexpress.excellentenchants.hook.impl.MythicMobsHook;
|
||||
import su.nightexpress.nightcore.manager.AbstractListener;
|
||||
import su.nightexpress.nightcore.util.Plugins;
|
||||
|
||||
public class EnchantPopulationListener extends AbstractListener<ExcellentEnchantsPlugin> {
|
||||
public class EnchantPopulationListener extends AbstractListener<EnchantsPlugin> {
|
||||
|
||||
public EnchantPopulationListener(@NotNull ExcellentEnchantsPlugin plugin) {
|
||||
public EnchantPopulationListener(@NotNull EnchantsPlugin plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,7 @@ public class EnchantPopulationListener extends AbstractListener<ExcellentEnchant
|
|||
if (equipment == null) return;
|
||||
|
||||
World world = entity.getWorld();
|
||||
boolean isMythic = Plugins.isLoaded(HookId.MYTHIC_MOBS) && MythicMobsHook.isMythicMob(entity);
|
||||
boolean isMythic = Plugins.isLoaded(HookPlugin.MYTHIC_MOBS) && MythicMobsHook.isMythicMob(entity);
|
||||
boolean doPopulation = Config.getDistributionWaySettings(DistributionWay.MOB_EQUIPMENT).isPresent() && !isMythic;
|
||||
|
||||
for (EquipmentSlot slot : EquipmentSlot.values()) {
|
||||
|
|
|
@ -6,7 +6,7 @@ import org.bukkit.event.inventory.InventoryType;
|
|||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.EnchantmentData;
|
||||
import su.nightexpress.excellentenchants.api.DistributionWay;
|
||||
import su.nightexpress.excellentenchants.config.Config;
|
||||
|
@ -32,7 +32,7 @@ import java.util.stream.IntStream;
|
|||
import static su.nightexpress.excellentenchants.Placeholders.*;
|
||||
import static su.nightexpress.nightcore.util.text.tag.Tags.*;
|
||||
|
||||
public class EnchantmentsListMenu extends ConfigMenu<ExcellentEnchantsPlugin> implements AutoFilled<EnchantmentData> {
|
||||
public class EnchantmentsListMenu extends ConfigMenu<EnchantsPlugin> implements AutoFilled<EnchantmentData> {
|
||||
|
||||
private static final String FILE_NAME = "enchants.yml";
|
||||
|
||||
|
@ -51,7 +51,7 @@ public class EnchantmentsListMenu extends ConfigMenu<ExcellentEnchantsPlugin> im
|
|||
private List<String> enchantLoreObtaining;
|
||||
private int[] enchantSlots;
|
||||
|
||||
public EnchantmentsListMenu(@NotNull ExcellentEnchantsPlugin plugin) {
|
||||
public EnchantmentsListMenu(@NotNull EnchantsPlugin plugin) {
|
||||
super(plugin, FileConfig.loadOrExtract(plugin, Config.DIR_MENU, FILE_NAME));
|
||||
this.keyLevel = new NamespacedKey(plugin, "list_display_level");
|
||||
this.iconCache = new HashMap<>();
|
||||
|
|
|
@ -10,7 +10,7 @@ import org.bukkit.event.player.PlayerFishEvent;
|
|||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.EnchantmentData;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.Rarity;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.type.*;
|
||||
|
@ -36,7 +36,7 @@ import java.util.*;
|
|||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class EnchantRegistry extends SimpleManager<ExcellentEnchantsPlugin> {
|
||||
public class EnchantRegistry extends SimpleManager<EnchantsPlugin> {
|
||||
|
||||
public static final Map<NamespacedKey, EnchantmentData> BY_KEY = new HashMap<>();
|
||||
public static final Map<String, EnchantmentData> BY_ID = new HashMap<>();
|
||||
|
@ -45,7 +45,7 @@ public class EnchantRegistry extends SimpleManager<ExcellentEnchantsPlugin> {
|
|||
|
||||
private boolean isLocked;
|
||||
|
||||
public EnchantRegistry(@NotNull ExcellentEnchantsPlugin plugin) {
|
||||
public EnchantRegistry(@NotNull EnchantsPlugin plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ public class EnchantRegistry extends SimpleManager<ExcellentEnchantsPlugin> {
|
|||
this.register(ConfusionEnchant.ID, file -> new ConfusionEnchant(plugin, file));
|
||||
this.register(CutterEnchant.ID, file -> new CutterEnchant(plugin, file));
|
||||
this.register(CurseOfDeathEnchant.ID, file -> new CurseOfDeathEnchant(plugin, file));
|
||||
this.register(EnchantDecapitator.ID, file -> new EnchantDecapitator(plugin, file));
|
||||
this.register(DecapitatorEnchant.ID, file -> new DecapitatorEnchant(plugin, file));
|
||||
this.register(DoubleStrikeEnchant.ID, file -> new DoubleStrikeEnchant(plugin, file));
|
||||
this.register(ExhaustEnchant.ID, file -> new ExhaustEnchant(plugin, file));
|
||||
this.register(WisdomEnchant.ID, file -> new WisdomEnchant(plugin, file));
|
||||
|
|
|
@ -7,7 +7,7 @@ import org.bukkit.event.EventPriority;
|
|||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.plugin.EventExecutor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.excellentenchants.ExcellentEnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.EnchantsPlugin;
|
||||
import su.nightexpress.excellentenchants.api.enchantment.EnchantmentData;
|
||||
import su.nightexpress.excellentenchants.enchantment.util.EnchantUtils;
|
||||
|
||||
|
@ -21,7 +21,7 @@ public class WrappedEvent<E extends Event, T extends EnchantmentData> implements
|
|||
private final Class<T> enchantClass;
|
||||
private final DataGather<E, T> dataGather;
|
||||
|
||||
public WrappedEvent(@NotNull ExcellentEnchantsPlugin plugin,
|
||||
public WrappedEvent(@NotNull EnchantsPlugin plugin,
|
||||
@NotNull EventPriority priority,
|
||||
@NotNull Class<E> eventClass,
|
||||
@NotNull Class<T> enchantClass,
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
package su.nightexpress.excellentenchants.hook;
|
||||
|
||||
public class HookId {
|
||||
|
||||
public static final String MYTHIC_MOBS = "MythicMobs";
|
||||
public static final String NCP = "NoCheatPlus";
|
||||
public static final String PROTOCOL_LIB = "ProtocolLib";
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue