Move classes from package com.songoda to com.craftaro; Changed links to Craftaro's wiki
This commit is contained in:
parent
8cd6e9c6b3
commit
8ccfc5c82d
9
pom.xml
9
pom.xml
|
@ -4,9 +4,9 @@
|
|||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.songoda</groupId>
|
||||
<groupId>com.craftaro</groupId>
|
||||
<artifactId>EpicEnchants</artifactId>
|
||||
<version>1.3.0-SNAPSHOT</version>
|
||||
<version>1.3.1-SNAPSHOT</version>
|
||||
|
||||
<name>EpicEnchants</name>
|
||||
<description>Unlock the potential of your weapons, tools and armor by making your own custom enchants.</description>
|
||||
|
@ -31,19 +31,18 @@
|
|||
</scm>
|
||||
|
||||
<build>
|
||||
<defaultGoal>clean install</defaultGoal>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.4.1</version>
|
||||
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
|
||||
<configuration>
|
||||
<finalName>${project.name}-${project.version}</finalName>
|
||||
|
||||
|
@ -54,7 +53,7 @@
|
|||
<relocations>
|
||||
<relocation>
|
||||
<pattern>com.craftaro.core</pattern>
|
||||
<shadedPattern>com.songoda.epicenchants.core</shadedPattern>
|
||||
<shadedPattern>com.craftaro.epicenchants.core</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package com.songoda.epicenchants;
|
||||
package com.craftaro.epicenchants;
|
||||
|
||||
import com.craftaro.core.utils.NumberUtils;
|
||||
import org.bukkit.command.CommandSender;
|
|
@ -1,4 +1,4 @@
|
|||
package com.songoda.epicenchants;
|
||||
package com.craftaro.epicenchants;
|
||||
|
||||
import com.craftaro.core.SongodaCore;
|
||||
import com.craftaro.core.SongodaPlugin;
|
||||
|
@ -7,35 +7,35 @@ import com.craftaro.core.configuration.Config;
|
|||
import com.craftaro.core.gui.GuiManager;
|
||||
import com.craftaro.core.hooks.EconomyManager;
|
||||
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
|
||||
import com.songoda.epicenchants.commands.CommandAlchemist;
|
||||
import com.songoda.epicenchants.commands.CommandApply;
|
||||
import com.songoda.epicenchants.commands.CommandEnchanter;
|
||||
import com.songoda.epicenchants.commands.CommandGiveBook;
|
||||
import com.songoda.epicenchants.commands.CommandGiveItemDust;
|
||||
import com.songoda.epicenchants.commands.CommandGiveRandomBook;
|
||||
import com.songoda.epicenchants.commands.CommandGiveScroll;
|
||||
import com.songoda.epicenchants.commands.CommandList;
|
||||
import com.songoda.epicenchants.commands.CommandReload;
|
||||
import com.songoda.epicenchants.commands.CommandSettings;
|
||||
import com.songoda.epicenchants.commands.CommandTinkerer;
|
||||
import com.songoda.epicenchants.listeners.ArmorListener;
|
||||
import com.songoda.epicenchants.listeners.EntityListener;
|
||||
import com.songoda.epicenchants.listeners.HeldItemListener;
|
||||
import com.songoda.epicenchants.listeners.PlayerListener;
|
||||
import com.songoda.epicenchants.listeners.item.BlackScrollListener;
|
||||
import com.songoda.epicenchants.listeners.item.BookListener;
|
||||
import com.songoda.epicenchants.listeners.item.DustListener;
|
||||
import com.songoda.epicenchants.listeners.item.WhiteScrollListener;
|
||||
import com.songoda.epicenchants.managers.EnchantManager;
|
||||
import com.songoda.epicenchants.managers.FileManager;
|
||||
import com.songoda.epicenchants.managers.GroupManager;
|
||||
import com.songoda.epicenchants.managers.InfoManager;
|
||||
import com.songoda.epicenchants.objects.Enchant;
|
||||
import com.songoda.epicenchants.utils.EnchantUtils;
|
||||
import com.songoda.epicenchants.utils.SpecialItems;
|
||||
import com.songoda.epicenchants.utils.objects.FastInv;
|
||||
import com.songoda.epicenchants.utils.settings.Settings;
|
||||
import com.songoda.epicenchants.utils.single.ItemGroup;
|
||||
import com.craftaro.epicenchants.listeners.ArmorListener;
|
||||
import com.craftaro.epicenchants.listeners.EntityListener;
|
||||
import com.craftaro.epicenchants.listeners.HeldItemListener;
|
||||
import com.craftaro.epicenchants.listeners.PlayerListener;
|
||||
import com.craftaro.epicenchants.listeners.item.BlackScrollListener;
|
||||
import com.craftaro.epicenchants.listeners.item.BookListener;
|
||||
import com.craftaro.epicenchants.listeners.item.DustListener;
|
||||
import com.craftaro.epicenchants.listeners.item.WhiteScrollListener;
|
||||
import com.craftaro.epicenchants.managers.EnchantManager;
|
||||
import com.craftaro.epicenchants.managers.FileManager;
|
||||
import com.craftaro.epicenchants.managers.GroupManager;
|
||||
import com.craftaro.epicenchants.managers.InfoManager;
|
||||
import com.craftaro.epicenchants.objects.Enchant;
|
||||
import com.craftaro.epicenchants.commands.CommandAlchemist;
|
||||
import com.craftaro.epicenchants.commands.CommandApply;
|
||||
import com.craftaro.epicenchants.commands.CommandEnchanter;
|
||||
import com.craftaro.epicenchants.commands.CommandGiveBook;
|
||||
import com.craftaro.epicenchants.commands.CommandGiveItemDust;
|
||||
import com.craftaro.epicenchants.commands.CommandGiveRandomBook;
|
||||
import com.craftaro.epicenchants.commands.CommandGiveScroll;
|
||||
import com.craftaro.epicenchants.commands.CommandList;
|
||||
import com.craftaro.epicenchants.commands.CommandReload;
|
||||
import com.craftaro.epicenchants.commands.CommandSettings;
|
||||
import com.craftaro.epicenchants.commands.CommandTinkerer;
|
||||
import com.craftaro.epicenchants.utils.EnchantUtils;
|
||||
import com.craftaro.epicenchants.utils.SpecialItems;
|
||||
import com.craftaro.epicenchants.utils.objects.FastInv;
|
||||
import com.craftaro.epicenchants.utils.settings.Settings;
|
||||
import com.craftaro.epicenchants.utils.single.ItemGroup;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package com.songoda.epicenchants.commands;
|
||||
package com.craftaro.epicenchants.commands;
|
||||
|
||||
import com.craftaro.core.commands.AbstractCommand;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.songoda.epicenchants.menus.AlchemistMenu;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.menus.AlchemistMenu;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
package com.songoda.epicenchants.commands;
|
||||
package com.craftaro.epicenchants.commands;
|
||||
|
||||
import com.craftaro.core.commands.AbstractCommand;
|
||||
import com.craftaro.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.epicenchants.CommandCommons;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.songoda.epicenchants.enums.EnchantResult;
|
||||
import com.songoda.epicenchants.objects.Enchant;
|
||||
import com.songoda.epicenchants.utils.Tuple;
|
||||
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
|
||||
import com.craftaro.epicenchants.objects.Enchant;
|
||||
import com.craftaro.epicenchants.CommandCommons;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.enums.EnchantResult;
|
||||
import com.craftaro.epicenchants.utils.Tuple;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
@ -16,8 +16,8 @@ import java.util.List;
|
|||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.songoda.epicenchants.enums.EnchantResult.BROKEN_FAILURE;
|
||||
import static com.songoda.epicenchants.utils.single.GeneralUtils.getMessageFromResult;
|
||||
import static com.craftaro.epicenchants.enums.EnchantResult.BROKEN_FAILURE;
|
||||
import static com.craftaro.epicenchants.utils.single.GeneralUtils.getMessageFromResult;
|
||||
|
||||
public class CommandApply extends AbstractCommand {
|
||||
private final EpicEnchants plugin;
|
||||
|
@ -65,7 +65,7 @@ public class CommandApply extends AbstractCommand {
|
|||
int level = Integer.parseInt(args[1]);
|
||||
Player player = (Player) sender;
|
||||
|
||||
if (!enchant.getItemWhitelist().contains(CompatibleMaterial.getMaterial(player.getItemInHand().getType()).get())) {
|
||||
if (!enchant.getItemWhitelist().contains(XMaterial.matchXMaterial(player.getItemInHand().getType()))) {
|
||||
System.out.println("List = " + enchant.getItemWhitelist());
|
||||
this.plugin.getLocale().getMessage("command.apply.invaliditem")
|
||||
.processPlaceholder("enchant", enchant.getIdentifier())
|
|
@ -1,8 +1,8 @@
|
|||
package com.songoda.epicenchants.commands;
|
||||
package com.craftaro.epicenchants.commands;
|
||||
|
||||
import com.craftaro.core.commands.AbstractCommand;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.songoda.epicenchants.menus.EnchanterMenu;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.menus.EnchanterMenu;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
package com.songoda.epicenchants.commands;
|
||||
package com.craftaro.epicenchants.commands;
|
||||
|
||||
import com.craftaro.core.commands.AbstractCommand;
|
||||
import com.songoda.epicenchants.CommandCommons;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.songoda.epicenchants.objects.Enchant;
|
||||
import com.craftaro.epicenchants.objects.Enchant;
|
||||
import com.craftaro.epicenchants.CommandCommons;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
|
@ -1,9 +1,9 @@
|
|||
package com.songoda.epicenchants.commands;
|
||||
package com.craftaro.epicenchants.commands;
|
||||
|
||||
import com.craftaro.core.commands.AbstractCommand;
|
||||
import com.songoda.epicenchants.CommandCommons;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.songoda.epicenchants.objects.Group;
|
||||
import com.craftaro.epicenchants.objects.Group;
|
||||
import com.craftaro.epicenchants.CommandCommons;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
|
@ -1,8 +1,8 @@
|
|||
package com.songoda.epicenchants.commands;
|
||||
package com.craftaro.epicenchants.commands;
|
||||
|
||||
import com.craftaro.core.commands.AbstractCommand;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.songoda.epicenchants.objects.Group;
|
||||
import com.craftaro.epicenchants.objects.Group;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
|
@ -1,8 +1,8 @@
|
|||
package com.songoda.epicenchants.commands;
|
||||
package com.craftaro.epicenchants.commands;
|
||||
|
||||
import com.craftaro.core.commands.AbstractCommand;
|
||||
import com.songoda.epicenchants.CommandCommons;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.CommandCommons;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
|
@ -1,7 +1,7 @@
|
|||
package com.songoda.epicenchants.commands;
|
||||
package com.craftaro.epicenchants.commands;
|
||||
|
||||
import com.craftaro.core.commands.AbstractCommand;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package com.songoda.epicenchants.commands;
|
||||
package com.craftaro.epicenchants.commands;
|
||||
|
||||
import com.craftaro.core.commands.AbstractCommand;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import java.util.List;
|
|
@ -1,8 +1,8 @@
|
|||
package com.songoda.epicenchants.commands;
|
||||
package com.craftaro.epicenchants.commands;
|
||||
|
||||
import com.craftaro.core.commands.AbstractCommand;
|
||||
import com.craftaro.core.configuration.editor.PluginConfigGui;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package com.songoda.epicenchants.commands;
|
||||
package com.craftaro.epicenchants.commands;
|
||||
|
||||
import com.craftaro.core.commands.AbstractCommand;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.songoda.epicenchants.menus.TinkererMenu;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.menus.TinkererMenu;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.songoda.epicenchants.effect;
|
||||
package com.craftaro.epicenchants.effect;
|
||||
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
|
@ -1,10 +1,10 @@
|
|||
package com.songoda.epicenchants.effect;
|
||||
package com.craftaro.epicenchants.effect;
|
||||
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.songoda.epicenchants.enums.TriggerType;
|
||||
import com.songoda.epicenchants.objects.Condition;
|
||||
import com.songoda.epicenchants.objects.LeveledModifier;
|
||||
import com.songoda.epicenchants.utils.single.GeneralUtils;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.enums.TriggerType;
|
||||
import com.craftaro.epicenchants.objects.Condition;
|
||||
import com.craftaro.epicenchants.objects.LeveledModifier;
|
||||
import com.craftaro.epicenchants.utils.single.GeneralUtils;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -18,8 +18,8 @@ import java.util.Set;
|
|||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.songoda.epicenchants.effect.EffectExecutor.Who.OPPONENT;
|
||||
import static com.songoda.epicenchants.effect.EffectExecutor.Who.USER;
|
||||
import static com.craftaro.epicenchants.effect.EffectExecutor.Who.OPPONENT;
|
||||
import static com.craftaro.epicenchants.effect.EffectExecutor.Who.USER;
|
||||
|
||||
public abstract class EffectExecutor {
|
||||
private final ConfigurationSection section;
|
|
@ -1,4 +1,4 @@
|
|||
package com.songoda.epicenchants.effect;
|
||||
package com.craftaro.epicenchants.effect;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
|
@ -17,7 +17,7 @@ public class EffectManager {
|
|||
|
||||
try {
|
||||
String formatted = UPPER_UNDERSCORE.to(UPPER_CAMEL, section.getName().toLowerCase()).replaceAll("-.*$", "");
|
||||
Class<?> clazz = Class.forName("com.songoda.epicenchants.effect.effects." + formatted);
|
||||
Class<?> clazz = Class.forName("com.craftaro.epicenchants.effect.effects." + formatted);
|
||||
Constructor<?> constructor = clazz.getConstructor(ConfigurationSection.class);
|
||||
Object object = constructor.newInstance(section);
|
||||
return Optional.of((EffectExecutor) object);
|
|
@ -1,8 +1,8 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.songoda.epicenchants.objects.LeveledModifier;
|
||||
import com.craftaro.epicenchants.effect.EffectExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.objects.LeveledModifier;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
|
@ -1,7 +1,7 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectEventExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.effect.EffectEventExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
|
@ -1,9 +1,9 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.songoda.epicenchants.utils.single.GeneralUtils;
|
||||
import com.songoda.epicenchants.utils.single.Placeholders;
|
||||
import com.craftaro.epicenchants.effect.EffectExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.utils.single.GeneralUtils;
|
||||
import com.craftaro.epicenchants.utils.single.Placeholders;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
|
@ -1,8 +1,8 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
|
||||
import com.songoda.epicenchants.effect.EffectExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.effect.EffectExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
|
@ -1,8 +1,8 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.songoda.epicenchants.utils.objects.ItemBuilder;
|
||||
import com.craftaro.epicenchants.effect.EffectExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.utils.objects.ItemBuilder;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
|
@ -1,8 +1,8 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.songoda.epicenchants.utils.objects.ItemBuilder;
|
||||
import com.craftaro.epicenchants.effect.EffectExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.utils.objects.ItemBuilder;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
|
@ -1,8 +1,8 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.songoda.epicenchants.objects.LeveledModifier;
|
||||
import com.craftaro.epicenchants.effect.EffectExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.objects.LeveledModifier;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
|
@ -1,7 +1,7 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.effect.EffectExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
|
@ -1,13 +1,13 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.effect.EffectExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static com.songoda.epicenchants.enums.EventType.ON;
|
||||
import static com.craftaro.epicenchants.enums.EventType.ON;
|
||||
|
||||
public class Fly extends EffectExecutor {
|
||||
public Fly(ConfigurationSection section) {
|
|
@ -1,7 +1,7 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.effect.EffectExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
|
@ -1,9 +1,9 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.songoda.epicenchants.utils.single.GeneralUtils;
|
||||
import com.songoda.epicenchants.utils.single.Placeholders;
|
||||
import com.craftaro.epicenchants.effect.EffectExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.utils.single.GeneralUtils;
|
||||
import com.craftaro.epicenchants.utils.single.Placeholders;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
|
@ -1,7 +1,7 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectEventExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.effect.EffectEventExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
|
@ -1,8 +1,8 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectEventExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.songoda.epicenchants.objects.LeveledModifier;
|
||||
import com.craftaro.epicenchants.effect.EffectEventExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.objects.LeveledModifier;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
|
@ -1,9 +1,9 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.songoda.epicenchants.objects.LeveledModifier;
|
||||
import com.songoda.epicenchants.utils.single.Experience;
|
||||
import com.craftaro.epicenchants.effect.EffectExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.objects.LeveledModifier;
|
||||
import com.craftaro.epicenchants.utils.single.Experience;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
|
@ -1,7 +1,7 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.effect.EffectExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
|
@ -1,7 +1,7 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.effect.EffectExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
|
@ -1,7 +1,7 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectEventExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.effect.EffectEventExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
|
@ -1,8 +1,8 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectEventExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.songoda.epicenchants.objects.LeveledModifier;
|
||||
import com.craftaro.epicenchants.effect.EffectEventExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.objects.LeveledModifier;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
|
@ -1,17 +1,16 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.songoda.epicenchants.utils.single.GeneralUtils;
|
||||
import com.songoda.epicenchants.utils.single.Placeholders;
|
||||
import com.craftaro.epicenchants.effect.EffectExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.utils.single.GeneralUtils;
|
||||
import com.craftaro.epicenchants.utils.single.Placeholders;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static com.songoda.epicenchants.effect.EffectExecutor.Who.OPPONENT;
|
||||
import static com.songoda.epicenchants.enums.EventType.NONE;
|
||||
import static com.songoda.epicenchants.enums.EventType.ON;
|
||||
import static com.craftaro.epicenchants.enums.EventType.NONE;
|
||||
import static com.craftaro.epicenchants.enums.EventType.ON;
|
||||
|
||||
public class PlayerCommand extends EffectExecutor {
|
||||
public PlayerCommand(ConfigurationSection section) {
|
||||
|
@ -24,7 +23,7 @@ public class PlayerCommand extends EffectExecutor {
|
|||
return;
|
||||
}
|
||||
|
||||
if (who() == OPPONENT && !(opponent instanceof Player)) {
|
||||
if (who() == Who.OPPONENT && !(opponent instanceof Player)) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.songoda.epicenchants.enums.TriggerType;
|
||||
import com.songoda.epicenchants.objects.LeveledModifier;
|
||||
import com.craftaro.epicenchants.effect.EffectExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.enums.TriggerType;
|
||||
import com.craftaro.epicenchants.objects.LeveledModifier;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
|
@ -1,7 +1,7 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.effect.EffectExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
|
@ -1,7 +1,7 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.effect.EffectExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
|
@ -1,9 +1,9 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.songoda.epicenchants.objects.LeveledModifier;
|
||||
import com.songoda.epicenchants.utils.objects.ItemBuilder;
|
||||
import com.craftaro.epicenchants.effect.EffectExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.objects.LeveledModifier;
|
||||
import com.craftaro.epicenchants.utils.objects.ItemBuilder;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.Entity;
|
||||
|
@ -14,8 +14,8 @@ import org.bukkit.entity.Player;
|
|||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import static com.songoda.epicenchants.objects.LeveledModifier.of;
|
||||
import static com.songoda.epicenchants.utils.single.GeneralUtils.color;
|
||||
import static com.craftaro.epicenchants.objects.LeveledModifier.of;
|
||||
import static com.craftaro.epicenchants.utils.single.GeneralUtils.color;
|
||||
import static java.util.concurrent.ThreadLocalRandom.current;
|
||||
|
||||
public class SpawnMob extends EffectExecutor {
|
|
@ -1,8 +1,8 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.songoda.epicenchants.objects.LeveledModifier;
|
||||
import com.craftaro.epicenchants.effect.EffectExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.objects.LeveledModifier;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.EntityType;
|
|
@ -1,15 +1,15 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.effect.EffectExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import static com.songoda.epicenchants.utils.single.Experience.changeExp;
|
||||
import static com.songoda.epicenchants.utils.single.Experience.getExp;
|
||||
import static com.craftaro.epicenchants.utils.single.Experience.changeExp;
|
||||
import static com.craftaro.epicenchants.utils.single.Experience.getExp;
|
||||
|
||||
public class StealExp extends EffectExecutor {
|
||||
public StealExp(ConfigurationSection section) {
|
|
@ -1,7 +1,7 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.effect.EffectExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
|
@ -1,7 +1,7 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.effect.EffectExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
|
@ -1,16 +1,14 @@
|
|||
package com.songoda.epicenchants.effect.effects;
|
||||
package com.craftaro.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.songoda.epicenchants.objects.LeveledModifier;
|
||||
import com.craftaro.epicenchants.effect.EffectExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.objects.LeveledModifier;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.Vector;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static com.songoda.epicenchants.effect.EffectExecutor.Who.USER;
|
||||
|
||||
public class Throw extends EffectExecutor {
|
||||
public Throw(ConfigurationSection section) {
|
||||
super(section);
|
||||
|
@ -28,7 +26,7 @@ public class Throw extends EffectExecutor {
|
|||
|
||||
Vector vector;
|
||||
double magnitude = LeveledModifier.of(getSection().getString("magnitude")).get(level, 0.1, user, opponent);
|
||||
LivingEntity livingEntity = who() == USER ? user : opponent;
|
||||
LivingEntity livingEntity = who() == Who.USER ? user : opponent;
|
||||
String relativeToStr = getSection().getString("relative-to");
|
||||
LivingEntity relative = relativeToStr == null || relativeToStr.equalsIgnoreCase("user") ? user : opponent;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.songoda.epicenchants.enums;
|
||||
package com.craftaro.epicenchants.enums;
|
||||
|
||||
public enum EnchantResult {
|
||||
SUCCESS, FAILURE, BROKEN_FAILURE, CONFLICT, MAXED_OUT, ALREADY_APPLIED, PROTECTED
|
|
@ -1,4 +1,4 @@
|
|||
package com.songoda.epicenchants.enums;
|
||||
package com.craftaro.epicenchants.enums;
|
||||
|
||||
public enum EventType {
|
||||
ON, OFF, NONE
|
|
@ -1,4 +1,4 @@
|
|||
package com.songoda.epicenchants.enums;
|
||||
package com.craftaro.epicenchants.enums;
|
||||
|
||||
public enum GiveType {
|
||||
WHITE_SCROLL, BLACK_SCROLL
|
|
@ -1,4 +1,4 @@
|
|||
package com.songoda.epicenchants.enums;
|
||||
package com.craftaro.epicenchants.enums;
|
||||
|
||||
public enum ItemType {
|
||||
BOOK,
|
|
@ -1,4 +1,4 @@
|
|||
package com.songoda.epicenchants.enums;
|
||||
package com.craftaro.epicenchants.enums;
|
||||
|
||||
public enum TriggerType {
|
||||
ATTACK_PLAYER_MELEE,
|
|
@ -1,4 +1,4 @@
|
|||
package com.songoda.epicenchants.events;
|
||||
package com.craftaro.epicenchants.events;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
|
@ -1,6 +1,6 @@
|
|||
package com.songoda.epicenchants.events;
|
||||
package com.craftaro.epicenchants.events;
|
||||
|
||||
import com.songoda.epicenchants.objects.Enchant;
|
||||
import com.craftaro.epicenchants.objects.Enchant;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
|
@ -1,4 +1,4 @@
|
|||
package com.songoda.epicenchants.events;
|
||||
package com.craftaro.epicenchants.events;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
|
@ -1,8 +1,6 @@
|
|||
package com.songoda.epicenchants.listeners;
|
||||
package com.craftaro.epicenchants.listeners;
|
||||
|
||||
import com.songoda.epicenchants.events.ArmorEquipEvent;
|
||||
import com.songoda.epicenchants.events.ArmorEquipEvent.ArmorType;
|
||||
import com.songoda.epicenchants.events.ArmorEquipEvent.EquipMethod;
|
||||
import com.craftaro.epicenchants.events.ArmorEquipEvent;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -56,7 +54,7 @@ public class ArmorListener implements Listener {
|
|||
numberKey = true;
|
||||
}
|
||||
|
||||
ArmorType newArmorType = ArmorType.matchType(shift ? e.getCurrentItem() : e.getCursor());
|
||||
ArmorEquipEvent.ArmorType newArmorType = ArmorEquipEvent.ArmorType.matchType(shift ? e.getCurrentItem() : e.getCursor());
|
||||
|
||||
if (!shift && newArmorType != null && e.getRawSlot() != newArmorType.getSlot()) {
|
||||
// Used for drag and drop checking to make sure you aren't trying to place a helmet in the boots slot.
|
||||
|
@ -64,14 +62,14 @@ public class ArmorListener implements Listener {
|
|||
}
|
||||
|
||||
if (shift) {
|
||||
newArmorType = ArmorType.matchType(e.getCurrentItem());
|
||||
newArmorType = ArmorEquipEvent.ArmorType.matchType(e.getCurrentItem());
|
||||
if (newArmorType != null) {
|
||||
boolean equipping = true;
|
||||
if (e.getRawSlot() == newArmorType.getSlot()) {
|
||||
equipping = false;
|
||||
}
|
||||
if (newArmorType.equals(ArmorType.HELMET) && (equipping == isAirOrNull(e.getWhoClicked().getInventory().getHelmet())) || newArmorType.equals(ArmorType.CHESTPLATE) && (equipping == isAirOrNull(e.getWhoClicked().getInventory().getChestplate())) || newArmorType.equals(ArmorType.LEGGINGS) && (equipping == isAirOrNull(e.getWhoClicked().getInventory().getLeggings())) || newArmorType.equals(ArmorType.BOOTS) && (equipping == isAirOrNull(e.getWhoClicked().getInventory().getBoots()))) {
|
||||
ArmorEquipEvent armorEquipEvent = new ArmorEquipEvent((Player) e.getWhoClicked(), EquipMethod.SHIFT_CLICK, newArmorType, equipping ? null : e.getCurrentItem(), equipping ? e.getCurrentItem() : null);
|
||||
if (newArmorType.equals(ArmorEquipEvent.ArmorType.HELMET) && (equipping == isAirOrNull(e.getWhoClicked().getInventory().getHelmet())) || newArmorType.equals(ArmorEquipEvent.ArmorType.CHESTPLATE) && (equipping == isAirOrNull(e.getWhoClicked().getInventory().getChestplate())) || newArmorType.equals(ArmorEquipEvent.ArmorType.LEGGINGS) && (equipping == isAirOrNull(e.getWhoClicked().getInventory().getLeggings())) || newArmorType.equals(ArmorEquipEvent.ArmorType.BOOTS) && (equipping == isAirOrNull(e.getWhoClicked().getInventory().getBoots()))) {
|
||||
ArmorEquipEvent armorEquipEvent = new ArmorEquipEvent((Player) e.getWhoClicked(), ArmorEquipEvent.EquipMethod.SHIFT_CLICK, newArmorType, equipping ? null : e.getCurrentItem(), equipping ? e.getCurrentItem() : null);
|
||||
Bukkit.getServer().getPluginManager().callEvent(armorEquipEvent);
|
||||
if (armorEquipEvent.isCancelled()) {
|
||||
e.setCancelled(true);
|
||||
|
@ -89,24 +87,24 @@ public class ArmorListener implements Listener {
|
|||
// e.getSlot() == Armor slot, can't use e.getRawSlot() as that gives a hotbar slot ;-;
|
||||
ItemStack hotbarItem = e.getClickedInventory().getItem(e.getHotbarButton());
|
||||
if (!isAirOrNull(hotbarItem)) {// Equipping
|
||||
newArmorType = ArmorType.matchType(hotbarItem);
|
||||
newArmorType = ArmorEquipEvent.ArmorType.matchType(hotbarItem);
|
||||
newArmorPiece = hotbarItem;
|
||||
oldArmorPiece = e.getClickedInventory().getItem(e.getSlot());
|
||||
} else {// Unequipping
|
||||
newArmorType = ArmorType.matchType(!isAirOrNull(e.getCurrentItem()) ? e.getCurrentItem() : e.getCursor());
|
||||
newArmorType = ArmorEquipEvent.ArmorType.matchType(!isAirOrNull(e.getCurrentItem()) ? e.getCurrentItem() : e.getCursor());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (isAirOrNull(e.getCursor()) && !isAirOrNull(e.getCurrentItem())) {// unequip with no new item going into the slot.
|
||||
newArmorType = ArmorType.matchType(e.getCurrentItem());
|
||||
newArmorType = ArmorEquipEvent.ArmorType.matchType(e.getCurrentItem());
|
||||
}
|
||||
// e.getCurrentItem() == Unequip
|
||||
// e.getCursor() == Equip
|
||||
// newArmorType = ArmorType.matchType(!isAirOrNull(e.getCurrentItem()) ? e.getCurrentItem() : e.getCursor());
|
||||
}
|
||||
if (newArmorType != null && e.getRawSlot() == newArmorType.getSlot()) {
|
||||
EquipMethod method = EquipMethod.PICK_DROP;
|
||||
if (e.getAction().equals(InventoryAction.HOTBAR_SWAP) || numberKey) method = EquipMethod.HOTBAR_SWAP;
|
||||
ArmorEquipEvent.EquipMethod method = ArmorEquipEvent.EquipMethod.PICK_DROP;
|
||||
if (e.getAction().equals(InventoryAction.HOTBAR_SWAP) || numberKey) method = ArmorEquipEvent.EquipMethod.HOTBAR_SWAP;
|
||||
ArmorEquipEvent armorEquipEvent = new ArmorEquipEvent((Player) e.getWhoClicked(), method, newArmorType, oldArmorPiece, newArmorPiece);
|
||||
Bukkit.getServer().getPluginManager().callEvent(armorEquipEvent);
|
||||
if (armorEquipEvent.isCancelled()) {
|
||||
|
@ -130,10 +128,10 @@ public class ArmorListener implements Listener {
|
|||
}*/
|
||||
}
|
||||
|
||||
ArmorType newArmorType = ArmorType.matchType(e.getItem());
|
||||
ArmorEquipEvent.ArmorType newArmorType = ArmorEquipEvent.ArmorType.matchType(e.getItem());
|
||||
if (newArmorType != null) {
|
||||
if (newArmorType.equals(ArmorType.HELMET) && isAirOrNull(e.getPlayer().getInventory().getHelmet()) || newArmorType.equals(ArmorType.CHESTPLATE) && isAirOrNull(e.getPlayer().getInventory().getChestplate()) || newArmorType.equals(ArmorType.LEGGINGS) && isAirOrNull(e.getPlayer().getInventory().getLeggings()) || newArmorType.equals(ArmorType.BOOTS) && isAirOrNull(e.getPlayer().getInventory().getBoots())) {
|
||||
ArmorEquipEvent armorEquipEvent = new ArmorEquipEvent(e.getPlayer(), EquipMethod.HOTBAR, ArmorType.matchType(e.getItem()), null, e.getItem());
|
||||
if (newArmorType.equals(ArmorEquipEvent.ArmorType.HELMET) && isAirOrNull(e.getPlayer().getInventory().getHelmet()) || newArmorType.equals(ArmorEquipEvent.ArmorType.CHESTPLATE) && isAirOrNull(e.getPlayer().getInventory().getChestplate()) || newArmorType.equals(ArmorEquipEvent.ArmorType.LEGGINGS) && isAirOrNull(e.getPlayer().getInventory().getLeggings()) || newArmorType.equals(ArmorEquipEvent.ArmorType.BOOTS) && isAirOrNull(e.getPlayer().getInventory().getBoots())) {
|
||||
ArmorEquipEvent armorEquipEvent = new ArmorEquipEvent(e.getPlayer(), ArmorEquipEvent.EquipMethod.HOTBAR, ArmorEquipEvent.ArmorType.matchType(e.getItem()), null, e.getItem());
|
||||
Bukkit.getServer().getPluginManager().callEvent(armorEquipEvent);
|
||||
if (armorEquipEvent.isCancelled()) {
|
||||
e.setCancelled(true);
|
||||
|
@ -150,10 +148,10 @@ public class ArmorListener implements Listener {
|
|||
return;
|
||||
}
|
||||
|
||||
ArmorType type = ArmorType.matchType(event.getOldCursor());
|
||||
ArmorEquipEvent.ArmorType type = ArmorEquipEvent.ArmorType.matchType(event.getOldCursor());
|
||||
|
||||
if (type != null && type.getSlot() == event.getRawSlots().stream().findFirst().orElse(0)) {
|
||||
ArmorEquipEvent armorEquipEvent = new ArmorEquipEvent((Player) event.getWhoClicked(), EquipMethod.DRAG, type, null, event.getOldCursor());
|
||||
ArmorEquipEvent armorEquipEvent = new ArmorEquipEvent((Player) event.getWhoClicked(), ArmorEquipEvent.EquipMethod.DRAG, type, null, event.getOldCursor());
|
||||
Bukkit.getServer().getPluginManager().callEvent(armorEquipEvent);
|
||||
if (armorEquipEvent.isCancelled()) {
|
||||
event.setResult(Result.DENY);
|
||||
|
@ -164,10 +162,10 @@ public class ArmorListener implements Listener {
|
|||
|
||||
@EventHandler
|
||||
public void itemBreakEvent(PlayerItemBreakEvent e) {
|
||||
ArmorType type = ArmorType.matchType(e.getBrokenItem());
|
||||
ArmorEquipEvent.ArmorType type = ArmorEquipEvent.ArmorType.matchType(e.getBrokenItem());
|
||||
if (type != null) {
|
||||
Player p = e.getPlayer();
|
||||
ArmorEquipEvent armorEquipEvent = new ArmorEquipEvent(p, EquipMethod.BROKE, type, e.getBrokenItem(), null);
|
||||
ArmorEquipEvent armorEquipEvent = new ArmorEquipEvent(p, ArmorEquipEvent.EquipMethod.BROKE, type, e.getBrokenItem(), null);
|
||||
Bukkit.getServer().getPluginManager().callEvent(armorEquipEvent);
|
||||
if (armorEquipEvent.isCancelled()) {
|
||||
ItemStack i = e.getBrokenItem().clone();
|
||||
|
@ -195,7 +193,7 @@ public class ArmorListener implements Listener {
|
|||
public void playerDeathEvent(PlayerDeathEvent event) {
|
||||
for (ItemStack item : event.getEntity().getInventory().getArmorContents()) {
|
||||
if (!isAirOrNull(item)) {
|
||||
Bukkit.getServer().getPluginManager().callEvent(new ArmorEquipEvent(event.getEntity(), EquipMethod.DEATH, ArmorType.matchType(item), item, null));
|
||||
Bukkit.getServer().getPluginManager().callEvent(new ArmorEquipEvent(event.getEntity(), ArmorEquipEvent.EquipMethod.DEATH, ArmorEquipEvent.ArmorType.matchType(item), item, null));
|
||||
// No way to cancel a death event.
|
||||
}
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
package com.songoda.epicenchants.listeners;
|
||||
package com.craftaro.epicenchants.listeners;
|
||||
|
||||
import com.craftaro.core.nms.Nms;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.songoda.epicenchants.enums.TriggerType;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.enums.TriggerType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Monster;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -17,7 +17,7 @@ import org.bukkit.event.entity.EntityExplodeEvent;
|
|||
import org.bukkit.event.entity.EntityTargetLivingEntityEvent;
|
||||
import org.bukkit.projectiles.ProjectileSource;
|
||||
|
||||
import static com.songoda.epicenchants.enums.TriggerType.*;
|
||||
import static com.craftaro.epicenchants.enums.TriggerType.*;
|
||||
|
||||
public class EntityListener implements Listener {
|
||||
private final EpicEnchants instance;
|
|
@ -1,8 +1,7 @@
|
|||
package com.songoda.epicenchants.listeners;
|
||||
package com.craftaro.epicenchants.listeners;
|
||||
|
||||
import com.songoda.epicenchants.events.ArmorEquipEvent;
|
||||
import com.songoda.epicenchants.events.HeldItemChangedEvent;
|
||||
import com.songoda.epicenchants.events.HeldItemChangedEvent.EquipMethod;
|
||||
import com.craftaro.epicenchants.events.ArmorEquipEvent;
|
||||
import com.craftaro.epicenchants.events.HeldItemChangedEvent;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -115,26 +114,26 @@ public class HeldItemListener implements Listener {
|
|||
} else {
|
||||
ItemStack newItem = e.getCursor();
|
||||
ItemStack oldItem = e.getCurrentItem();
|
||||
EquipMethod method;
|
||||
HeldItemChangedEvent.EquipMethod method;
|
||||
if (numberKey) {
|
||||
if (!(e.getClickedInventory() instanceof PlayerInventory)
|
||||
|| e.getHotbarButton() != heldslot) //we only care about heldslot
|
||||
return;
|
||||
method = EquipMethod.HOTBAR_SWAP;
|
||||
method = HeldItemChangedEvent.EquipMethod.HOTBAR_SWAP;
|
||||
newItem = e.getCurrentItem();
|
||||
oldItem = e.getClickedInventory().getItem(e.getHotbarButton());
|
||||
} else if (swapoffhand) {
|
||||
if (!(e.getClickedInventory() instanceof PlayerInventory)
|
||||
|| e.getSlot() != heldslot) //we only care about heldslot
|
||||
return;
|
||||
method = EquipMethod.OFFHAND_SWAP;
|
||||
method = HeldItemChangedEvent.EquipMethod.OFFHAND_SWAP;
|
||||
newItem = e.getClickedInventory().getItem(40);
|
||||
oldItem = e.getCurrentItem();
|
||||
} else {
|
||||
if (!(e.getClickedInventory() instanceof PlayerInventory)
|
||||
|| e.getSlot() != heldslot) //we only care about heldslot
|
||||
return;
|
||||
method = EquipMethod.PICK_DROP;
|
||||
method = HeldItemChangedEvent.EquipMethod.PICK_DROP;
|
||||
}
|
||||
HeldItemChangedEvent heldItemChangedEvent = new HeldItemChangedEvent((Player) e.getWhoClicked(), method, oldItem, newItem);
|
||||
Bukkit.getServer().getPluginManager().callEvent(heldItemChangedEvent);
|
||||
|
@ -154,7 +153,7 @@ public class HeldItemListener implements Listener {
|
|||
boolean bottominventory = rawslot != invslot;
|
||||
|
||||
if (bottominventory && event.getWhoClicked().getInventory().getHeldItemSlot() == invslot) {
|
||||
HeldItemChangedEvent heldItemChangedEvent = new HeldItemChangedEvent((Player) event.getWhoClicked(), EquipMethod.DRAG, null, event.getOldCursor());
|
||||
HeldItemChangedEvent heldItemChangedEvent = new HeldItemChangedEvent((Player) event.getWhoClicked(), HeldItemChangedEvent.EquipMethod.DRAG, null, event.getOldCursor());
|
||||
Bukkit.getServer().getPluginManager().callEvent(heldItemChangedEvent);
|
||||
if (heldItemChangedEvent.isCancelled()) {
|
||||
event.setResult(Result.DENY);
|
||||
|
@ -175,7 +174,7 @@ public class HeldItemListener implements Listener {
|
|||
hotbarslot = inv.getHeldItemSlot();
|
||||
|
||||
if (hotbarslot != -1) {
|
||||
HeldItemChangedEvent heldItemChangedEvent = new HeldItemChangedEvent(p, EquipMethod.BROKE, e.getBrokenItem(), null);
|
||||
HeldItemChangedEvent heldItemChangedEvent = new HeldItemChangedEvent(p, HeldItemChangedEvent.EquipMethod.BROKE, e.getBrokenItem(), null);
|
||||
Bukkit.getServer().getPluginManager().callEvent(heldItemChangedEvent);
|
||||
if (heldItemChangedEvent.isCancelled()) {
|
||||
ItemStack i = e.getBrokenItem().clone();
|
||||
|
@ -190,7 +189,7 @@ public class HeldItemListener implements Listener {
|
|||
public void playerDeathEvent(PlayerDeathEvent event) {
|
||||
ItemStack i = event.getEntity().getInventory().getItem(event.getEntity().getInventory().getHeldItemSlot());
|
||||
if (!isAirOrNull(i)) {
|
||||
Bukkit.getServer().getPluginManager().callEvent(new HeldItemChangedEvent(event.getEntity(), EquipMethod.DEATH, i, null));
|
||||
Bukkit.getServer().getPluginManager().callEvent(new HeldItemChangedEvent(event.getEntity(), HeldItemChangedEvent.EquipMethod.DEATH, i, null));
|
||||
}
|
||||
// No way to cancel a death event.
|
||||
}
|
||||
|
@ -202,7 +201,7 @@ public class HeldItemListener implements Listener {
|
|||
//we try to make a best efford solution
|
||||
//when the item in the held slot is null we assume it was dropped by pressing Q
|
||||
if (isAirOrNull(event.getPlayer().getInventory().getItem(event.getPlayer().getInventory().getHeldItemSlot())))
|
||||
Bukkit.getServer().getPluginManager().callEvent(new HeldItemChangedEvent(event.getPlayer(), EquipMethod.DROP_ITEM, event.getItemDrop().getItemStack(), null));
|
||||
Bukkit.getServer().getPluginManager().callEvent(new HeldItemChangedEvent(event.getPlayer(), HeldItemChangedEvent.EquipMethod.DROP_ITEM, event.getItemDrop().getItemStack(), null));
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
|
||||
|
@ -211,7 +210,7 @@ public class HeldItemListener implements Listener {
|
|||
int firstEmpty = event.getPlayer().getInventory().firstEmpty();
|
||||
if (0 <= firstEmpty && firstEmpty <= 8
|
||||
&& event.getPlayer().getInventory().getHeldItemSlot() == firstEmpty)
|
||||
Bukkit.getServer().getPluginManager().callEvent(new HeldItemChangedEvent(event.getPlayer(), EquipMethod.PICKUP_ITEM, null, event.getItem().getItemStack()));
|
||||
Bukkit.getServer().getPluginManager().callEvent(new HeldItemChangedEvent(event.getPlayer(), HeldItemChangedEvent.EquipMethod.PICKUP_ITEM, null, event.getItem().getItemStack()));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
package com.songoda.epicenchants.listeners;
|
||||
package com.craftaro.epicenchants.listeners;
|
||||
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.songoda.epicenchants.events.ArmorEquipEvent;
|
||||
import com.songoda.epicenchants.events.HeldItemChangedEvent;
|
||||
import com.songoda.epicenchants.objects.Enchant;
|
||||
import com.craftaro.epicenchants.events.ArmorEquipEvent;
|
||||
import com.craftaro.epicenchants.events.HeldItemChangedEvent;
|
||||
import com.craftaro.epicenchants.objects.Enchant;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
@ -19,9 +19,9 @@ import org.bukkit.inventory.ItemStack;
|
|||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.songoda.epicenchants.enums.EventType.OFF;
|
||||
import static com.songoda.epicenchants.enums.EventType.ON;
|
||||
import static com.songoda.epicenchants.enums.TriggerType.*;
|
||||
import static com.craftaro.epicenchants.enums.EventType.OFF;
|
||||
import static com.craftaro.epicenchants.enums.EventType.ON;
|
||||
import static com.craftaro.epicenchants.enums.TriggerType.*;
|
||||
|
||||
public class PlayerListener implements Listener {
|
||||
private final EpicEnchants instance;
|
|
@ -1,14 +1,14 @@
|
|||
package com.songoda.epicenchants.listeners.item;
|
||||
package com.craftaro.epicenchants.listeners.item;
|
||||
|
||||
import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTCompound;
|
||||
import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.songoda.epicenchants.objects.Enchant;
|
||||
import com.songoda.epicenchants.utils.single.RomanNumber;
|
||||
import com.craftaro.epicenchants.objects.Enchant;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.utils.single.RomanNumber;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import static com.songoda.epicenchants.utils.single.GeneralUtils.getRandomElement;
|
||||
import static com.craftaro.epicenchants.utils.single.GeneralUtils.getRandomElement;
|
||||
|
||||
public class BlackScrollListener extends ItemListener {
|
||||
public BlackScrollListener(EpicEnchants instance) {
|
|
@ -1,14 +1,14 @@
|
|||
package com.songoda.epicenchants.listeners.item;
|
||||
package com.craftaro.epicenchants.listeners.item;
|
||||
|
||||
import com.craftaro.core.compatibility.CompatibleMaterial;
|
||||
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
|
||||
import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.songoda.epicenchants.enums.EnchantResult;
|
||||
import com.songoda.epicenchants.events.EnchantApplyEvent;
|
||||
import com.songoda.epicenchants.objects.Enchant;
|
||||
import com.songoda.epicenchants.objects.Group;
|
||||
import com.songoda.epicenchants.utils.Tuple;
|
||||
import com.songoda.epicenchants.utils.single.GeneralUtils;
|
||||
import com.craftaro.epicenchants.events.EnchantApplyEvent;
|
||||
import com.craftaro.epicenchants.objects.Enchant;
|
||||
import com.craftaro.epicenchants.objects.Group;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.enums.EnchantResult;
|
||||
import com.craftaro.epicenchants.utils.Tuple;
|
||||
import com.craftaro.epicenchants.utils.single.GeneralUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
|
@ -17,10 +17,10 @@ import org.bukkit.inventory.ItemStack;
|
|||
|
||||
import java.util.Optional;
|
||||
|
||||
import static com.songoda.epicenchants.enums.EnchantResult.ALREADY_APPLIED;
|
||||
import static com.songoda.epicenchants.enums.EnchantResult.BROKEN_FAILURE;
|
||||
import static com.songoda.epicenchants.enums.EnchantResult.CONFLICT;
|
||||
import static com.songoda.epicenchants.enums.EnchantResult.MAXED_OUT;
|
||||
import static com.craftaro.epicenchants.enums.EnchantResult.ALREADY_APPLIED;
|
||||
import static com.craftaro.epicenchants.enums.EnchantResult.BROKEN_FAILURE;
|
||||
import static com.craftaro.epicenchants.enums.EnchantResult.CONFLICT;
|
||||
import static com.craftaro.epicenchants.enums.EnchantResult.MAXED_OUT;
|
||||
import static java.util.concurrent.ThreadLocalRandom.current;
|
||||
|
||||
public class BookListener extends ItemListener {
|
||||
|
@ -39,7 +39,7 @@ public class BookListener extends ItemListener {
|
|||
ItemStack toApply = event.getCurrentItem();
|
||||
Enchant enchant = this.instance.getEnchantManager().getValue(cursor.getString("enchant")).orElseThrow(() -> new IllegalStateException("Book without enchant!"));
|
||||
|
||||
if (!enchant.getItemWhitelist().contains(CompatibleMaterial.getMaterial(current.getItem().getType()).get())) {
|
||||
if (!enchant.getItemWhitelist().contains(XMaterial.matchXMaterial(current.getItem().getType()))) {
|
||||
return;
|
||||
}
|
||||
// get total amount of enchantments on item
|
|
@ -1,9 +1,9 @@
|
|||
package com.songoda.epicenchants.listeners.item;
|
||||
package com.craftaro.epicenchants.listeners.item;
|
||||
|
||||
import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.songoda.epicenchants.objects.Enchant;
|
||||
import com.songoda.epicenchants.objects.Group;
|
||||
import com.craftaro.epicenchants.objects.Enchant;
|
||||
import com.craftaro.epicenchants.objects.Group;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package com.songoda.epicenchants.listeners.item;
|
||||
package com.craftaro.epicenchants.listeners.item;
|
||||
|
||||
import com.craftaro.core.compatibility.CompatibleHand;
|
||||
import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
|
@ -1,9 +1,9 @@
|
|||
package com.songoda.epicenchants.listeners.item;
|
||||
package com.craftaro.epicenchants.listeners.item;
|
||||
|
||||
import com.craftaro.core.compatibility.CompatibleMaterial;
|
||||
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
|
||||
import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.songoda.epicenchants.utils.objects.ItemBuilder;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.utils.objects.ItemBuilder;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
|
@ -26,7 +26,7 @@ public class WhiteScrollListener extends ItemListener {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!this.instance.getItemGroup().isValid(CompatibleMaterial.getMaterial(event.getCurrentItem().getType()).get())) {
|
||||
if (!this.instance.getItemGroup().isValid(XMaterial.matchXMaterial(event.getCurrentItem().getType()))) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package com.songoda.epicenchants.managers;
|
||||
package com.craftaro.epicenchants.managers;
|
||||
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.songoda.epicenchants.objects.Enchant;
|
||||
import com.songoda.epicenchants.objects.Group;
|
||||
import com.craftaro.epicenchants.objects.Enchant;
|
||||
import com.craftaro.epicenchants.objects.Group;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
|
@ -12,7 +12,7 @@ import java.util.Collections;
|
|||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.songoda.epicenchants.utils.single.ConfigParser.parseEnchant;
|
||||
import static com.craftaro.epicenchants.utils.single.ConfigParser.parseEnchant;
|
||||
|
||||
public class EnchantManager extends Manager<String, Enchant> {
|
||||
public EnchantManager(EpicEnchants instance) {
|
|
@ -1,9 +1,9 @@
|
|||
package com.songoda.epicenchants.managers;
|
||||
package com.craftaro.epicenchants.managers;
|
||||
|
||||
import com.craftaro.core.compatibility.ServerVersion;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.songoda.epicenchants.utils.objects.FileLocation;
|
||||
import com.songoda.epicenchants.utils.settings.Settings;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.utils.objects.FileLocation;
|
||||
import com.craftaro.epicenchants.utils.settings.Settings;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.InvalidConfigurationException;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
|
@ -20,7 +20,7 @@ import java.util.LinkedHashSet;
|
|||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import static com.songoda.epicenchants.utils.objects.FileLocation.of;
|
||||
import static com.craftaro.epicenchants.utils.objects.FileLocation.of;
|
||||
import static java.io.File.separator;
|
||||
import static java.util.Arrays.asList;
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package com.songoda.epicenchants.managers;
|
||||
package com.craftaro.epicenchants.managers;
|
||||
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.songoda.epicenchants.objects.Group;
|
||||
import com.songoda.epicenchants.utils.single.ConfigParser;
|
||||
import com.craftaro.epicenchants.objects.Group;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.utils.single.ConfigParser;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
|
||||
public class GroupManager extends Manager<String, Group> {
|
|
@ -1,9 +1,9 @@
|
|||
package com.songoda.epicenchants.managers;
|
||||
package com.craftaro.epicenchants.managers;
|
||||
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.songoda.epicenchants.menus.InfoMenu;
|
||||
import com.songoda.epicenchants.menus.MainInfoMenu;
|
||||
import com.songoda.epicenchants.objects.Group;
|
||||
import com.craftaro.epicenchants.objects.Group;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.menus.InfoMenu;
|
||||
import com.craftaro.epicenchants.menus.MainInfoMenu;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.songoda.epicenchants.managers;
|
||||
package com.craftaro.epicenchants.managers;
|
||||
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
|
@ -1,14 +1,14 @@
|
|||
package com.songoda.epicenchants.menus;
|
||||
package com.craftaro.epicenchants.menus;
|
||||
|
||||
import com.craftaro.core.hooks.EconomyManager;
|
||||
import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.songoda.epicenchants.objects.Enchant;
|
||||
import com.songoda.epicenchants.objects.Group;
|
||||
import com.songoda.epicenchants.objects.Placeholder;
|
||||
import com.songoda.epicenchants.utils.objects.FastInv;
|
||||
import com.songoda.epicenchants.utils.objects.ItemBuilder;
|
||||
import com.songoda.epicenchants.utils.single.GeneralUtils;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.objects.Enchant;
|
||||
import com.craftaro.epicenchants.objects.Group;
|
||||
import com.craftaro.epicenchants.objects.Placeholder;
|
||||
import com.craftaro.epicenchants.utils.objects.FastInv;
|
||||
import com.craftaro.epicenchants.utils.objects.ItemBuilder;
|
||||
import com.craftaro.epicenchants.utils.single.GeneralUtils;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -18,11 +18,10 @@ import org.bukkit.inventory.ItemStack;
|
|||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.songoda.epicenchants.objects.Placeholder.of;
|
||||
import static com.songoda.epicenchants.utils.single.Experience.changeExp;
|
||||
import static com.songoda.epicenchants.utils.single.Experience.getExp;
|
||||
import static com.songoda.epicenchants.utils.single.GeneralUtils.color;
|
||||
import static com.songoda.epicenchants.utils.single.GeneralUtils.getSlots;
|
||||
import static com.craftaro.epicenchants.utils.single.Experience.changeExp;
|
||||
import static com.craftaro.epicenchants.utils.single.Experience.getExp;
|
||||
import static com.craftaro.epicenchants.utils.single.GeneralUtils.color;
|
||||
import static com.craftaro.epicenchants.utils.single.GeneralUtils.getSlots;
|
||||
|
||||
public class AlchemistMenu extends FastInv {
|
||||
private final EpicEnchants instance;
|
||||
|
@ -213,23 +212,23 @@ public class AlchemistMenu extends FastInv {
|
|||
int rightDestroy = rightItem.getInteger("destroy-rate");
|
||||
|
||||
Placeholder[] placeholders = new Placeholder[] {
|
||||
of("left_success_rate", leftSuccess),
|
||||
of("right_success_rate", rightSuccess),
|
||||
of("left_destroy_rate", leftDestroy),
|
||||
of("right_destroy_rate", rightDestroy),
|
||||
of("max_destroy_rate", Math.max(leftDestroy, rightDestroy)),
|
||||
of("min_destroy_rate", Math.min(leftDestroy, rightDestroy)),
|
||||
of("max_success_rate", Math.max(leftSuccess, rightSuccess)),
|
||||
of("min_success_rate", Math.min(leftSuccess, rightSuccess))
|
||||
Placeholder.of("left_success_rate", leftSuccess),
|
||||
Placeholder.of("right_success_rate", rightSuccess),
|
||||
Placeholder.of("left_destroy_rate", leftDestroy),
|
||||
Placeholder.of("right_destroy_rate", rightDestroy),
|
||||
Placeholder.of("max_destroy_rate", Math.max(leftDestroy, rightDestroy)),
|
||||
Placeholder.of("min_destroy_rate", Math.min(leftDestroy, rightDestroy)),
|
||||
Placeholder.of("max_success_rate", Math.max(leftSuccess, rightSuccess)),
|
||||
Placeholder.of("min_success_rate", Math.min(leftSuccess, rightSuccess))
|
||||
};
|
||||
|
||||
int successRate = getFromFormula("book.success-rate-formula", placeholders);
|
||||
int destroyRate = getFromFormula("book.destroy-rate-formula", placeholders);
|
||||
|
||||
Placeholder[] costPlaceholders = new Placeholder[] {
|
||||
of("group_order_index", enchant.getGroup().getOrder()),
|
||||
of("final_success_rate", successRate),
|
||||
of("final_destroy_rate", destroyRate),
|
||||
Placeholder.of("group_order_index", enchant.getGroup().getOrder()),
|
||||
Placeholder.of("final_success_rate", successRate),
|
||||
Placeholder.of("final_destroy_rate", destroyRate),
|
||||
};
|
||||
|
||||
ecoCost = getFromFormula("book.eco-cost-formula", costPlaceholders);
|
||||
|
@ -240,15 +239,15 @@ public class AlchemistMenu extends FastInv {
|
|||
Group group = this.instance.getGroupManager().getValue(leftItem.getString("group")).orElseThrow(() -> new IllegalStateException("Dust without group!"));
|
||||
|
||||
Placeholder[] placeholders = new Placeholder[] {
|
||||
of("left_percentage", leftItem.getInteger("percentage")),
|
||||
of("right_percentage", rightItem.getInteger("percentage"))
|
||||
Placeholder.of("left_percentage", leftItem.getInteger("percentage")),
|
||||
Placeholder.of("right_percentage", rightItem.getInteger("percentage"))
|
||||
};
|
||||
|
||||
int successRate = getFromFormula("dust.percentage-formula", placeholders);
|
||||
|
||||
Placeholder[] costPlaceholders = new Placeholder[] {
|
||||
of("group_order_index", group.getOrder()),
|
||||
of("final_success_rate", successRate),
|
||||
Placeholder.of("group_order_index", group.getOrder()),
|
||||
Placeholder.of("final_success_rate", successRate),
|
||||
};
|
||||
|
||||
ecoCost = getFromFormula("dust.eco-cost-formula", costPlaceholders);
|
||||
|
@ -266,8 +265,8 @@ public class AlchemistMenu extends FastInv {
|
|||
}
|
||||
|
||||
addItem(this.ACCEPT_SLOT, new ItemBuilder(this.config.getConfigurationSection("contents.accept-after"),
|
||||
of("eco_cost", ecoCost),
|
||||
of("exp_cost", expCost)
|
||||
Placeholder.of("eco_cost", ecoCost),
|
||||
Placeholder.of("exp_cost", expCost)
|
||||
).build(), event -> {
|
||||
if (!EconomyManager.hasBalance(event.getPlayer(), ecoCost) || getExp(event.getPlayer()) < expCost) {
|
||||
this.instance.getLocale().getMessage("alchemist.cannotafford").sendPrefixedMessage(event.getPlayer());
|
|
@ -1,10 +1,11 @@
|
|||
package com.songoda.epicenchants.menus;
|
||||
package com.craftaro.epicenchants.menus;
|
||||
|
||||
import com.craftaro.core.hooks.EconomyManager;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.songoda.epicenchants.objects.Group;
|
||||
import com.songoda.epicenchants.utils.objects.FastInv;
|
||||
import com.songoda.epicenchants.utils.objects.ItemBuilder;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.objects.Group;
|
||||
import com.craftaro.epicenchants.objects.Placeholder;
|
||||
import com.craftaro.epicenchants.utils.objects.FastInv;
|
||||
import com.craftaro.epicenchants.utils.objects.ItemBuilder;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
@ -13,11 +14,10 @@ import java.util.HashMap;
|
|||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.songoda.epicenchants.objects.Placeholder.of;
|
||||
import static com.songoda.epicenchants.utils.single.Experience.changeExp;
|
||||
import static com.songoda.epicenchants.utils.single.Experience.getExp;
|
||||
import static com.songoda.epicenchants.utils.single.GeneralUtils.color;
|
||||
import static com.songoda.epicenchants.utils.single.GeneralUtils.getSlots;
|
||||
import static com.craftaro.epicenchants.utils.single.Experience.changeExp;
|
||||
import static com.craftaro.epicenchants.utils.single.Experience.getExp;
|
||||
import static com.craftaro.epicenchants.utils.single.GeneralUtils.color;
|
||||
import static com.craftaro.epicenchants.utils.single.GeneralUtils.getSlots;
|
||||
|
||||
public class EnchanterMenu extends FastInv {
|
||||
private final Map<UUID, Long> delay = new HashMap<>();
|
||||
|
@ -44,10 +44,10 @@ public class EnchanterMenu extends FastInv {
|
|||
Group group = instance.getGroupManager().getValue(section.getString("group").toUpperCase())
|
||||
.orElseThrow(() -> new IllegalArgumentException("Invalid group set in enchanter: " + section.getString("group")));
|
||||
ItemStack itemStack = new ItemBuilder(section,
|
||||
of("exp_cost", expCost),
|
||||
of("eco_cost", ecoCost),
|
||||
of("exp_left", xpLeft),
|
||||
of("eco_left", ecoLeft)).build();
|
||||
Placeholder.of("exp_cost", expCost),
|
||||
Placeholder.of("eco_cost", ecoCost),
|
||||
Placeholder.of("exp_left", xpLeft),
|
||||
Placeholder.of("eco_left", ecoLeft)).build();
|
||||
|
||||
addItem(getSlots(section.getString("slot")), itemStack, event -> {
|
||||
// Todo: wanna change this
|
|
@ -1,10 +1,11 @@
|
|||
package com.songoda.epicenchants.menus;
|
||||
package com.craftaro.epicenchants.menus;
|
||||
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.songoda.epicenchants.objects.Enchant;
|
||||
import com.songoda.epicenchants.objects.Group;
|
||||
import com.songoda.epicenchants.utils.objects.FastInv;
|
||||
import com.songoda.epicenchants.utils.objects.ItemBuilder;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.objects.Enchant;
|
||||
import com.craftaro.epicenchants.objects.Group;
|
||||
import com.craftaro.epicenchants.objects.Placeholder;
|
||||
import com.craftaro.epicenchants.utils.objects.FastInv;
|
||||
import com.craftaro.epicenchants.utils.objects.ItemBuilder;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
|
||||
|
@ -13,9 +14,8 @@ import java.util.Set;
|
|||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import static com.songoda.epicenchants.objects.Placeholder.of;
|
||||
import static com.songoda.epicenchants.utils.single.GeneralUtils.color;
|
||||
import static com.songoda.epicenchants.utils.single.GeneralUtils.getSlots;
|
||||
import static com.craftaro.epicenchants.utils.single.GeneralUtils.color;
|
||||
import static com.craftaro.epicenchants.utils.single.GeneralUtils.getSlots;
|
||||
import static java.util.Arrays.stream;
|
||||
|
||||
public class InfoMenu extends FastInv {
|
||||
|
@ -54,12 +54,12 @@ public class InfoMenu extends FastInv {
|
|||
.collect(Collectors.joining(", "));
|
||||
|
||||
addItem(slot, new ItemBuilder(config.getConfigurationSection("enchant-item"),
|
||||
of("group_color", enchant.getGroup().getColor()),
|
||||
of("enchant", enchant.getIdentifier()),
|
||||
of("max_level", enchant.getMaxLevel()),
|
||||
of("applicable_to", whitelist),
|
||||
of("enchant", enchant.getIdentifier()),
|
||||
of("description", enchant
|
||||
Placeholder.of("group_color", enchant.getGroup().getColor()),
|
||||
Placeholder.of("enchant", enchant.getIdentifier()),
|
||||
Placeholder.of("max_level", enchant.getMaxLevel()),
|
||||
Placeholder.of("applicable_to", whitelist),
|
||||
Placeholder.of("enchant", enchant.getIdentifier()),
|
||||
Placeholder.of("description", enchant
|
||||
.getDescription()
|
||||
.stream()
|
||||
.map(s -> config.getString("enchant-item.description-color") + s)
|
|
@ -1,14 +1,14 @@
|
|||
package com.songoda.epicenchants.menus;
|
||||
package com.craftaro.epicenchants.menus;
|
||||
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.songoda.epicenchants.objects.Group;
|
||||
import com.songoda.epicenchants.utils.objects.FastInv;
|
||||
import com.songoda.epicenchants.utils.objects.ItemBuilder;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.objects.Group;
|
||||
import com.craftaro.epicenchants.utils.objects.FastInv;
|
||||
import com.craftaro.epicenchants.utils.objects.ItemBuilder;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
import static com.songoda.epicenchants.utils.single.GeneralUtils.color;
|
||||
import static com.songoda.epicenchants.utils.single.GeneralUtils.getSlots;
|
||||
import static com.craftaro.epicenchants.utils.single.GeneralUtils.color;
|
||||
import static com.craftaro.epicenchants.utils.single.GeneralUtils.getSlots;
|
||||
|
||||
public class MainInfoMenu extends FastInv implements Listener {
|
||||
public MainInfoMenu(EpicEnchants instance, FileConfiguration config) {
|
|
@ -1,12 +1,12 @@
|
|||
package com.songoda.epicenchants.menus;
|
||||
package com.craftaro.epicenchants.menus;
|
||||
|
||||
import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTCompound;
|
||||
import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.songoda.epicenchants.enums.ItemType;
|
||||
import com.songoda.epicenchants.objects.Enchant;
|
||||
import com.songoda.epicenchants.utils.objects.FastInv;
|
||||
import com.songoda.epicenchants.utils.objects.ItemBuilder;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.objects.Enchant;
|
||||
import com.craftaro.epicenchants.enums.ItemType;
|
||||
import com.craftaro.epicenchants.utils.objects.FastInv;
|
||||
import com.craftaro.epicenchants.utils.objects.ItemBuilder;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
|
@ -22,11 +22,11 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.songoda.epicenchants.enums.ItemType.BOOK;
|
||||
import static com.songoda.epicenchants.enums.ItemType.ENCHANTED;
|
||||
import static com.songoda.epicenchants.enums.ItemType.NONE;
|
||||
import static com.songoda.epicenchants.utils.single.GeneralUtils.color;
|
||||
import static com.songoda.epicenchants.utils.single.GeneralUtils.getSlots;
|
||||
import static com.craftaro.epicenchants.enums.ItemType.BOOK;
|
||||
import static com.craftaro.epicenchants.enums.ItemType.ENCHANTED;
|
||||
import static com.craftaro.epicenchants.enums.ItemType.NONE;
|
||||
import static com.craftaro.epicenchants.utils.single.GeneralUtils.color;
|
||||
import static com.craftaro.epicenchants.utils.single.GeneralUtils.getSlots;
|
||||
import static java.util.Arrays.stream;
|
||||
|
||||
public class TinkererMenu extends FastInv {
|
|
@ -1,12 +1,12 @@
|
|||
package com.songoda.epicenchants.objects;
|
||||
package com.craftaro.epicenchants.objects;
|
||||
|
||||
import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.songoda.epicenchants.utils.objects.ItemBuilder;
|
||||
import com.songoda.epicenchants.utils.settings.Settings;
|
||||
import com.songoda.epicenchants.utils.single.GeneralUtils;
|
||||
import com.songoda.epicenchants.utils.single.ItemGroup;
|
||||
import com.songoda.epicenchants.utils.single.RomanNumber;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.utils.objects.ItemBuilder;
|
||||
import com.craftaro.epicenchants.utils.settings.Settings;
|
||||
import com.craftaro.epicenchants.utils.single.GeneralUtils;
|
||||
import com.craftaro.epicenchants.utils.single.ItemGroup;
|
||||
import com.craftaro.epicenchants.utils.single.RomanNumber;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
|
@ -14,7 +14,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.songoda.epicenchants.utils.single.GeneralUtils.color;
|
||||
import static com.craftaro.epicenchants.utils.single.GeneralUtils.color;
|
||||
import static java.util.concurrent.ThreadLocalRandom.current;
|
||||
|
||||
public class BookItem {
|
|
@ -1,7 +1,7 @@
|
|||
package com.songoda.epicenchants.objects;
|
||||
package com.craftaro.epicenchants.objects;
|
||||
|
||||
import com.songoda.epicenchants.utils.single.GeneralUtils;
|
||||
import com.songoda.epicenchants.utils.single.Placeholders;
|
||||
import com.craftaro.epicenchants.utils.single.GeneralUtils;
|
||||
import com.craftaro.epicenchants.utils.single.Placeholders;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
|
@ -1,10 +1,10 @@
|
|||
package com.songoda.epicenchants.objects;
|
||||
package com.craftaro.epicenchants.objects;
|
||||
|
||||
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
|
||||
import com.songoda.epicenchants.effect.EffectExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.songoda.epicenchants.enums.TriggerType;
|
||||
import com.songoda.epicenchants.utils.single.RomanNumber;
|
||||
import com.craftaro.epicenchants.effect.EffectExecutor;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.enums.TriggerType;
|
||||
import com.craftaro.epicenchants.utils.single.RomanNumber;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
|
@ -15,7 +15,7 @@ import java.util.HashSet;
|
|||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.songoda.epicenchants.utils.single.GeneralUtils.color;
|
||||
import static com.craftaro.epicenchants.utils.single.GeneralUtils.color;
|
||||
|
||||
public class Enchant {
|
||||
private final String author;
|
|
@ -1,4 +1,4 @@
|
|||
package com.songoda.epicenchants.objects;
|
||||
package com.craftaro.epicenchants.objects;
|
||||
|
||||
public class Group {
|
||||
private final String identifier;
|
|
@ -1,7 +1,7 @@
|
|||
package com.songoda.epicenchants.objects;
|
||||
package com.craftaro.epicenchants.objects;
|
||||
|
||||
import com.songoda.epicenchants.utils.single.GeneralUtils;
|
||||
import com.songoda.epicenchants.utils.single.Placeholders;
|
||||
import com.craftaro.epicenchants.utils.single.GeneralUtils;
|
||||
import com.craftaro.epicenchants.utils.single.Placeholders;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.songoda.epicenchants.objects;
|
||||
package com.craftaro.epicenchants.objects;
|
||||
|
||||
public class Placeholder {
|
||||
private final String placeholder;
|
|
@ -1,17 +1,17 @@
|
|||
package com.songoda.epicenchants.utils;
|
||||
package com.craftaro.epicenchants.utils;
|
||||
|
||||
import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTCompound;
|
||||
import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem;
|
||||
import com.craftaro.core.utils.NumberUtils;
|
||||
import com.craftaro.core.utils.TextUtils;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.songoda.epicenchants.enums.EnchantResult;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.songoda.epicenchants.enums.TriggerType;
|
||||
import com.songoda.epicenchants.objects.Enchant;
|
||||
import com.songoda.epicenchants.utils.objects.ItemBuilder;
|
||||
import com.songoda.epicenchants.utils.settings.Settings;
|
||||
import com.songoda.epicenchants.utils.single.GeneralUtils;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.enums.EnchantResult;
|
||||
import com.craftaro.epicenchants.enums.EventType;
|
||||
import com.craftaro.epicenchants.enums.TriggerType;
|
||||
import com.craftaro.epicenchants.objects.Enchant;
|
||||
import com.craftaro.epicenchants.utils.objects.ItemBuilder;
|
||||
import com.craftaro.epicenchants.utils.settings.Settings;
|
||||
import com.craftaro.epicenchants.utils.single.GeneralUtils;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -31,15 +31,6 @@ import java.util.Objects;
|
|||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.songoda.epicenchants.enums.EnchantResult.ALREADY_APPLIED;
|
||||
import static com.songoda.epicenchants.enums.EnchantResult.BROKEN_FAILURE;
|
||||
import static com.songoda.epicenchants.enums.EnchantResult.CONFLICT;
|
||||
import static com.songoda.epicenchants.enums.EnchantResult.FAILURE;
|
||||
import static com.songoda.epicenchants.enums.EnchantResult.MAXED_OUT;
|
||||
import static com.songoda.epicenchants.enums.EnchantResult.PROTECTED;
|
||||
import static com.songoda.epicenchants.enums.EnchantResult.SUCCESS;
|
||||
import static com.songoda.epicenchants.enums.TriggerType.HELD_ITEM;
|
||||
|
||||
public class EnchantUtils {
|
||||
|
||||
private final EpicEnchants instance;
|
||||
|
@ -56,15 +47,15 @@ public class EnchantUtils {
|
|||
Set<String> currentConflicts = currentEnchantMap.keySet().stream().map(Enchant::getConflict).flatMap(Collection::stream).collect(Collectors.toSet());
|
||||
|
||||
if (enchant.getConflict().stream().anyMatch(currentIds::contains) || currentConflicts.contains(enchant.getIdentifier())) {
|
||||
return Tuple.of(itemStack, CONFLICT);
|
||||
return Tuple.of(itemStack, EnchantResult.CONFLICT);
|
||||
}
|
||||
|
||||
if (currentEnchantMap.entrySet().stream().anyMatch(entry -> entry.getKey().equals(enchant) && entry.getValue() == enchant.getMaxLevel())) {
|
||||
return Tuple.of(itemStack, MAXED_OUT);
|
||||
return Tuple.of(itemStack, EnchantResult.MAXED_OUT);
|
||||
}
|
||||
|
||||
if (currentEnchantMap.entrySet().stream().anyMatch(entry -> entry.getKey().equals(enchant) && entry.getValue() >= level)) {
|
||||
return Tuple.of(itemStack, ALREADY_APPLIED);
|
||||
return Tuple.of(itemStack, EnchantResult.ALREADY_APPLIED);
|
||||
}
|
||||
|
||||
if (!GeneralUtils.chance(successRate)) {
|
||||
|
@ -72,11 +63,11 @@ public class EnchantUtils {
|
|||
if (hasProtection) {
|
||||
NBTItem nbtItem = new ItemBuilder(itemStack).removeLore(this.instance.getSpecialItems().getWhiteScrollLore()).nbt();
|
||||
nbtItem.removeKey("protected");
|
||||
return Tuple.of(nbtItem.getItem(), PROTECTED);
|
||||
return Tuple.of(nbtItem.getItem(), EnchantResult.PROTECTED);
|
||||
}
|
||||
return Tuple.of(new ItemStack(Material.AIR), BROKEN_FAILURE);
|
||||
return Tuple.of(new ItemStack(Material.AIR), EnchantResult.BROKEN_FAILURE);
|
||||
}
|
||||
return Tuple.of(itemStack, FAILURE);
|
||||
return Tuple.of(itemStack, EnchantResult.FAILURE);
|
||||
}
|
||||
|
||||
ItemBuilder itemBuilder = new ItemBuilder(itemStack);
|
||||
|
@ -97,7 +88,7 @@ public class EnchantUtils {
|
|||
NBTCompound compound = nbtItem.getOrCreateCompound("enchants");
|
||||
compound.setInteger(enchant.getIdentifier(), level);
|
||||
|
||||
return Tuple.of(nbtItem.getItem(), SUCCESS);
|
||||
return Tuple.of(nbtItem.getItem(), EnchantResult.SUCCESS);
|
||||
}
|
||||
|
||||
public Map<Enchant, Integer> getEnchants(ItemStack itemStack) {
|
||||
|
@ -125,7 +116,7 @@ public class EnchantUtils {
|
|||
stacks.add(GeneralUtils.getHeldItem(player, event));
|
||||
stacks.removeIf(Objects::isNull);
|
||||
|
||||
if (triggerType == HELD_ITEM) {
|
||||
if (triggerType == TriggerType.HELD_ITEM) {
|
||||
stacks = Collections.singletonList(player.getItemInHand());
|
||||
}
|
||||
|
|
@ -1,10 +1,11 @@
|
|||
package com.songoda.epicenchants.utils;
|
||||
package com.craftaro.epicenchants.utils;
|
||||
|
||||
import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.songoda.epicenchants.objects.Group;
|
||||
import com.songoda.epicenchants.utils.objects.ItemBuilder;
|
||||
import com.songoda.epicenchants.utils.settings.Settings;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.objects.Group;
|
||||
import com.craftaro.epicenchants.objects.Placeholder;
|
||||
import com.craftaro.epicenchants.utils.objects.ItemBuilder;
|
||||
import com.craftaro.epicenchants.utils.settings.Settings;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
@ -12,8 +13,7 @@ import org.jetbrains.annotations.Nullable;
|
|||
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
import static com.songoda.epicenchants.objects.Placeholder.of;
|
||||
import static com.songoda.epicenchants.utils.single.GeneralUtils.color;
|
||||
import static com.craftaro.epicenchants.utils.single.GeneralUtils.color;
|
||||
|
||||
public class SpecialItems {
|
||||
private final EpicEnchants instance;
|
||||
|
@ -34,7 +34,7 @@ public class SpecialItems {
|
|||
|
||||
public ItemStack getBlackScroll(int amount, int chance) {
|
||||
int successRate = chance == -1 ? ThreadLocalRandom.current().nextInt(Settings.BLACK_MIN.getInt(), Settings.BLACK_MAX.getInt() + 1) : chance;
|
||||
NBTItem nbtItem = new ItemBuilder(this.instance.getFileManager().getConfiguration("items/special-items").getConfigurationSection("black-scroll"), of("success-rate", successRate)).nbt();
|
||||
NBTItem nbtItem = new ItemBuilder(this.instance.getFileManager().getConfiguration("items/special-items").getConfigurationSection("black-scroll"), Placeholder.of("success-rate", successRate)).nbt();
|
||||
|
||||
nbtItem.setBoolean("black-scroll", true);
|
||||
nbtItem.setInteger("success-rate", successRate);
|
||||
|
@ -48,8 +48,8 @@ public class SpecialItems {
|
|||
|
||||
public ItemStack getMysteryBook(Group group) {
|
||||
NBTItem nbtItem = new ItemBuilder(this.instance.getFileManager().getConfiguration("items/special-items").getConfigurationSection("mystery-book"),
|
||||
of("group-color", group.getColor()),
|
||||
of("group-name", group.getName())).nbt();
|
||||
Placeholder.of("group-color", group.getColor()),
|
||||
Placeholder.of("group-name", group.getName())).nbt();
|
||||
|
||||
nbtItem.setBoolean("mystery-book", true);
|
||||
nbtItem.setString("group", group.getIdentifier());
|
||||
|
@ -63,10 +63,10 @@ public class SpecialItems {
|
|||
|
||||
public ItemStack getSecretDust(Group group, int max) {
|
||||
NBTItem nbtItem = new ItemBuilder(this.instance.getFileManager().getConfiguration("items/dusts").getConfigurationSection("secret-dust"),
|
||||
of("group-color", group.getColor()),
|
||||
of("group-name", group.getName()),
|
||||
of("max-rate", max),
|
||||
of("min-rate", 0)).nbt();
|
||||
Placeholder.of("group-color", group.getColor()),
|
||||
Placeholder.of("group-name", group.getName()),
|
||||
Placeholder.of("max-rate", max),
|
||||
Placeholder.of("min-rate", 0)).nbt();
|
||||
|
||||
nbtItem.setBoolean("secret-dust", true);
|
||||
nbtItem.setString("group", group.getIdentifier());
|
||||
|
@ -103,9 +103,9 @@ public class SpecialItems {
|
|||
}
|
||||
|
||||
NBTItem nbtItem = new ItemBuilder(config,
|
||||
of("group-color", group.getColor()),
|
||||
of("group-name", group.getName()),
|
||||
of("percentage", percentage)).nbt();
|
||||
Placeholder.of("group-color", group.getColor()),
|
||||
Placeholder.of("group-name", group.getName()),
|
||||
Placeholder.of("percentage", percentage)).nbt();
|
||||
|
||||
if (type.equalsIgnoreCase("mystery")) {
|
||||
return nbtItem.getItem();
|
|
@ -1,4 +1,4 @@
|
|||
package com.songoda.epicenchants.utils;
|
||||
package com.craftaro.epicenchants.utils;
|
||||
|
||||
public class Tuple<key, value> {
|
||||
private final key x;
|
|
@ -1,4 +1,4 @@
|
|||
package com.songoda.epicenchants.utils.objects;
|
||||
package com.craftaro.epicenchants.utils.objects;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
|
@ -1,4 +1,4 @@
|
|||
package com.songoda.epicenchants.utils.objects;
|
||||
package com.craftaro.epicenchants.utils.objects;
|
||||
|
||||
public class FileLocation {
|
||||
private final boolean required, versionDependent;
|
|
@ -1,11 +1,11 @@
|
|||
package com.songoda.epicenchants.utils.objects;
|
||||
package com.craftaro.epicenchants.utils.objects;
|
||||
|
||||
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
|
||||
import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem;
|
||||
import com.songoda.epicenchants.objects.Placeholder;
|
||||
import com.songoda.epicenchants.utils.single.ConfigParser;
|
||||
import com.songoda.epicenchants.utils.single.GeneralUtils;
|
||||
import com.songoda.epicenchants.wrappers.EnchantmentWrapper;
|
||||
import com.craftaro.epicenchants.objects.Placeholder;
|
||||
import com.craftaro.epicenchants.wrappers.EnchantmentWrapper;
|
||||
import com.craftaro.epicenchants.utils.single.ConfigParser;
|
||||
import com.craftaro.epicenchants.utils.single.GeneralUtils;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
|
@ -24,7 +24,7 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.songoda.epicenchants.utils.single.GeneralUtils.color;
|
||||
import static com.craftaro.epicenchants.utils.single.GeneralUtils.color;
|
||||
|
||||
public class ItemBuilder {
|
||||
private final ItemStack item;
|
|
@ -1,9 +1,9 @@
|
|||
package com.songoda.epicenchants.utils.settings;
|
||||
package com.craftaro.epicenchants.utils.settings;
|
||||
|
||||
import com.craftaro.core.configuration.Config;
|
||||
import com.craftaro.core.configuration.ConfigSetting;
|
||||
import com.craftaro.core.hooks.EconomyManager;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
package com.songoda.epicenchants.utils.single;
|
||||
package com.craftaro.epicenchants.utils.single;
|
||||
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
import com.songoda.epicenchants.effect.EffectManager;
|
||||
import com.songoda.epicenchants.objects.BookItem;
|
||||
import com.songoda.epicenchants.objects.Enchant;
|
||||
import com.songoda.epicenchants.objects.Group;
|
||||
import com.songoda.epicenchants.objects.LeveledModifier;
|
||||
import com.songoda.epicenchants.wrappers.EnchantmentWrapper;
|
||||
import com.craftaro.epicenchants.EpicEnchants;
|
||||
import com.craftaro.epicenchants.effect.EffectManager;
|
||||
import com.craftaro.epicenchants.objects.BookItem;
|
||||
import com.craftaro.epicenchants.objects.Enchant;
|
||||
import com.craftaro.epicenchants.objects.Group;
|
||||
import com.craftaro.epicenchants.objects.LeveledModifier;
|
||||
import com.craftaro.epicenchants.wrappers.EnchantmentWrapper;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
|
@ -18,8 +18,6 @@ import java.util.HashSet;
|
|||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.songoda.epicenchants.utils.single.GeneralUtils.color;
|
||||
|
||||
public class ConfigParser {
|
||||
public static Enchant parseEnchant(EpicEnchants instance, FileConfiguration config) {
|
||||
return Enchant.builder()
|
||||
|
@ -27,7 +25,7 @@ public class ConfigParser {
|
|||
.identifier(config.getString("identifier"))
|
||||
.group(instance.getGroupManager().getValue(config.getString("group").toUpperCase()).orElseThrow(() -> new IllegalArgumentException("Invalid group: " + config.getString("group"))))
|
||||
.maxLevel(config.getInt("max-level"))
|
||||
.format(config.isSet("applied-format") ? color(config.getString("applied-format")) : "")
|
||||
.format(config.isSet("applied-format") ? GeneralUtils.color(config.getString("applied-format")) : "")
|
||||
.bookItem(parseBookItem(instance, config.getConfigurationSection("book-item")))
|
||||
.itemWhitelist((config.isList("item-whitelist") ? config.getStringList("item-whitelist").stream().map(instance.getItemGroup()::get).flatMap(Collection::stream).collect(Collectors.toSet()) : Collections.emptySet()))
|
||||
.conflict(config.isList("conflicting-enchants") ? new HashSet<>(config.getStringList("conflicting-enchants")) : Collections.emptySet())
|
||||
|
@ -53,7 +51,7 @@ public class ConfigParser {
|
|||
return section != null ? BookItem.builder()
|
||||
.instance(instance)
|
||||
.material(Material.valueOf(section.getString("material")))
|
||||
.displayName(color(section.getString("display-name")))
|
||||
.displayName(GeneralUtils.color(section.getString("display-name")))
|
||||
.lore(section.getStringList("lore").stream().map(GeneralUtils::color).collect(Collectors.toList()))
|
||||
.build() : null;
|
||||
}
|
||||
|
@ -62,7 +60,7 @@ public class ConfigParser {
|
|||
return section != null ? Group.builder()
|
||||
.order(section.getInt("order"))
|
||||
.identifier(section.getName())
|
||||
.name(color(section.getString("group-name")))
|
||||
.name(GeneralUtils.color(section.getString("group-name")))
|
||||
.format(section.getString("group-lore-format"))
|
||||
.color(section.getString("group-color"))
|
||||
.descriptionColor(section.getString("description-color"))
|
|
@ -1,4 +1,4 @@
|
|||
package com.songoda.epicenchants.utils.single;
|
||||
package com.craftaro.epicenchants.utils.single;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
package com.songoda.epicenchants.utils.single;
|
||||
package com.craftaro.epicenchants.utils.single;
|
||||
|
||||
import com.craftaro.core.compatibility.CompatibleHand;
|
||||
import com.craftaro.core.math.MathUtils;
|
||||
import com.songoda.epicenchants.enums.EnchantResult;
|
||||
import com.songoda.epicenchants.enums.TriggerType;
|
||||
import com.craftaro.epicenchants.enums.EnchantResult;
|
||||
import com.craftaro.epicenchants.enums.TriggerType;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
|
@ -1,6 +1,5 @@
|
|||
package com.songoda.epicenchants.utils.single;
|
||||
package com.craftaro.epicenchants.utils.single;
|
||||
|
||||
import com.craftaro.core.compatibility.CompatibleMaterial;
|
||||
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial;
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
@ -54,7 +53,7 @@ public class ItemGroup {
|
|||
|
||||
optionalGroup.ifPresent(group -> output.addAll(getMaterials(group)));
|
||||
|
||||
Optional<XMaterial> material = CompatibleMaterial.getMaterial(key);
|
||||
Optional<XMaterial> material = XMaterial.matchXMaterial(key);
|
||||
material.ifPresent(output::add);
|
||||
|
||||
return output;
|
|
@ -1,4 +1,4 @@
|
|||
package com.songoda.epicenchants.utils.single;
|
||||
package com.craftaro.epicenchants.utils.single;
|
||||
|
||||
import me.clip.placeholderapi.PlaceholderAPI;
|
||||
import org.bukkit.Bukkit;
|
||||
|
@ -27,7 +27,7 @@ import java.util.regex.Matcher;
|
|||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.songoda.epicenchants.utils.single.GeneralUtils.getHeldItem;
|
||||
import static com.craftaro.epicenchants.utils.single.GeneralUtils.getHeldItem;
|
||||
|
||||
public class Placeholders {
|
||||
private static final Map<String, Function<Event, String>> EVENT_FUNCTIONS = new HashMap<String, Function<Event, String>>() {{
|
|
@ -1,4 +1,4 @@
|
|||
package com.songoda.epicenchants.utils.single;
|
||||
package com.craftaro.epicenchants.utils.single;
|
||||
|
||||
import java.util.TreeMap;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.songoda.epicenchants.wrappers;
|
||||
package com.craftaro.epicenchants.wrappers;
|
||||
|
||||
import com.songoda.epicenchants.objects.LeveledModifier;
|
||||
import com.craftaro.epicenchants.objects.LeveledModifier;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
|
@ -1,4 +1,4 @@
|
|||
author: Songoda
|
||||
author: Craftaro
|
||||
|
||||
# The enchant identifier must be unique.
|
||||
identifier: AntiGravity
|
||||
|
@ -20,7 +20,7 @@ description:
|
|||
item-whitelist:
|
||||
- "BOOTS"
|
||||
|
||||
# For a full list of effects, please visit: https://wiki.songoda.com/Epic_Enchants#Tutorials
|
||||
# For a full list of effects, please visit: https://wiki.craftaro.com/index.php/Epic_Enchants#Tutorials
|
||||
effects:
|
||||
POTION:
|
||||
# The trigger that will fire this effect.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
author: Songoda
|
||||
author: Craftaro
|
||||
|
||||
# The enchant identifier must be unique.
|
||||
identifier: Frozen
|
||||
|
@ -21,7 +21,7 @@ description:
|
|||
item-whitelist:
|
||||
- "ARMOR"
|
||||
|
||||
# For a full list of effects, please visit: https://wiki.songoda.com/Epic_Enchants#Tutorials
|
||||
# For a full list of effects, please visit: https://wiki.craftaro.com/index.php/Epic_Enchants#Tutorials
|
||||
effects:
|
||||
POTION:
|
||||
# The trigger that will fire this effect.
|
||||
|
|
|
@ -30,7 +30,7 @@ description:
|
|||
item-whitelist:
|
||||
- "ARMOR"
|
||||
|
||||
# For a full list of effects, please visit: https://wiki.songoda.com/Epic_Enchants#Tutorials
|
||||
# For a full list of effects, please visit: https://wiki.craftaro.com/index.php/Epic_Enchants#Tutorials
|
||||
effects:
|
||||
REMOVE_EFFECT:
|
||||
# The trigger that will fire this effect.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
author: Songoda
|
||||
author: Craftaro
|
||||
|
||||
# The enchant identifier must be unique.
|
||||
identifier: Poison
|
||||
|
@ -20,7 +20,7 @@ description:
|
|||
item-whitelist:
|
||||
- "SWORDS"
|
||||
|
||||
# For a full list of effects, please visit: https://wiki.songoda.com/Epic_Enchants#Tutorials
|
||||
# For a full list of effects, please visit: https://wiki.craftaro.com/index.php/Epic_Enchants#Tutorials
|
||||
effects:
|
||||
POTION:
|
||||
# The trigger that will fire this effect.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
author: Songoda
|
||||
author: Craftaro
|
||||
|
||||
# The enchant identifier must be unique.
|
||||
identifier: RocketEscape
|
||||
|
@ -20,7 +20,7 @@ description:
|
|||
item-whitelist:
|
||||
- "BOOTS"
|
||||
|
||||
# For a full list of effects, please visit: https://wiki.songoda.com/Epic_Enchants#Tutorials
|
||||
# For a full list of effects, please visit: https://wiki.craftaro.com/index.php/Epic_Enchants#Tutorials
|
||||
effects:
|
||||
THROW:
|
||||
# The trigger that will fire this effect.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
author: Songoda
|
||||
author: Craftaro
|
||||
|
||||
# The enchant identifier must be unique.
|
||||
identifier: Shockwave
|
||||
|
@ -21,7 +21,7 @@ description:
|
|||
item-whitelist:
|
||||
- "CHESTPLATES"
|
||||
|
||||
# For a full list of effects, please visit: https://wiki.songoda.com/display/SON/EpicEnchants
|
||||
# For a full list of effects, please visit: https://wiki.craftaro.com/index.php/Epic_Enchants#Tutorials
|
||||
effects:
|
||||
THROW:
|
||||
# The trigger that will fire this effect.
|
||||
|
@ -33,4 +33,4 @@ effects:
|
|||
# Magnitude of the throw.
|
||||
magnitude: "{level} * 0.2"
|
||||
# Chance of the effect firing.
|
||||
chance: "{level} * 3"
|
||||
chance: "{level} * 3"
|
||||
|
|
|
@ -32,7 +32,7 @@ description:
|
|||
item-whitelist:
|
||||
- "PICKAXE"
|
||||
|
||||
# For a full list of effects, please visit: https://wiki.songoda.com/Epic_Enchants#Tutorials
|
||||
# For a full list of effects, please visit: https://wiki.craftaro.com/index.php/Epic_Enchants#Tutorials
|
||||
effects:
|
||||
SPAWN_TNT:
|
||||
# The trigger that will fire this effect.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
author: Songoda
|
||||
author: Craftaro
|
||||
|
||||
# The enchant identifier must be unique.
|
||||
identifier: Wither
|
||||
|
@ -21,7 +21,7 @@ description:
|
|||
item-whitelist:
|
||||
- "ARMOR"
|
||||
|
||||
# For a full list of effects, please visit: https://wiki.songoda.com/Epic_Enchants#Tutorials
|
||||
# For a full list of effects, please visit: https://wiki.craftaro.com/index.php/Epic_Enchants#Tutorials
|
||||
effects:
|
||||
POTION:
|
||||
# The trigger that will fire this effect.
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue