mirror of
https://github.com/songoda/EpicEnchants.git
synced 2024-12-31 21:48:28 +01:00
Merge branch 'development'
This commit is contained in:
commit
860dd752ad
17
pom.xml
17
pom.xml
@ -2,7 +2,7 @@
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>EpicEnchants</artifactId>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<version>1.1.10</version>
|
||||
<version>1.1.11</version>
|
||||
<build>
|
||||
<defaultGoal>clean install</defaultGoal>
|
||||
<finalName>EpicEnchants-${project.version}</finalName>
|
||||
@ -41,7 +41,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<version>3.3.0-SNAPSHOT</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>shaded</id>
|
||||
@ -74,11 +74,16 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>apache.snapshots</id>
|
||||
<url>https://repository.apache.org/snapshots/</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>public</id>
|
||||
<url>http://repo.songoda.com/repository/public/</url>
|
||||
<url>https://repo.songoda.com/repository/public/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>jitpack.io</id>
|
||||
@ -90,7 +95,8 @@
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.16.4</version>
|
||||
<version>1.17</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.mrmicky</groupId>
|
||||
@ -108,6 +114,7 @@
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>UltimateBottles</artifactId>
|
||||
<version>1_0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.clip</groupId>
|
||||
|
@ -7,7 +7,7 @@ import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.configuration.Config;
|
||||
import com.songoda.core.gui.GuiManager;
|
||||
import com.songoda.core.hooks.EconomyManager;
|
||||
import com.songoda.epicenchants.command.commands.*;
|
||||
import com.songoda.epicenchants.commands.*;
|
||||
import com.songoda.epicenchants.listeners.ArmorListener;
|
||||
import com.songoda.epicenchants.listeners.EntityListener;
|
||||
import com.songoda.epicenchants.listeners.HeldItemListener;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.songoda.epicenchants.command.commands;
|
||||
package com.songoda.epicenchants.commands;
|
||||
|
||||
import com.songoda.core.commands.AbstractCommand;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.songoda.epicenchants.command.commands;
|
||||
package com.songoda.epicenchants.commands;
|
||||
|
||||
import com.songoda.core.commands.AbstractCommand;
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
@ -22,7 +22,7 @@ import static com.songoda.epicenchants.utils.single.GeneralUtils.getMessageFromR
|
||||
public class CommandApply extends AbstractCommand {
|
||||
|
||||
private final EpicEnchants plugin;
|
||||
|
||||
|
||||
public CommandApply(EpicEnchants plugin) {
|
||||
super(true, "apply");
|
||||
this.plugin = plugin;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.songoda.epicenchants.command.commands;
|
||||
package com.songoda.epicenchants.commands;
|
||||
|
||||
import com.songoda.core.commands.AbstractCommand;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.songoda.epicenchants.command.commands;
|
||||
package com.songoda.epicenchants.commands;
|
||||
|
||||
import com.songoda.core.commands.AbstractCommand;
|
||||
import com.songoda.epicenchants.CommandCommons;
|
||||
@ -17,7 +17,7 @@ import java.util.stream.Collectors;
|
||||
public class CommandGiveBook extends AbstractCommand {
|
||||
|
||||
private final EpicEnchants plugin;
|
||||
|
||||
|
||||
public CommandGiveBook(EpicEnchants plugin) {
|
||||
super(false, "givebook");
|
||||
this.plugin = plugin;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.songoda.epicenchants.command.commands;
|
||||
package com.songoda.epicenchants.commands;
|
||||
|
||||
import com.songoda.core.commands.AbstractCommand;
|
||||
import com.songoda.epicenchants.CommandCommons;
|
||||
@ -15,7 +15,7 @@ import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class CommandGiveItemDust extends AbstractCommand {
|
||||
|
||||
|
||||
private final EpicEnchants plugin;
|
||||
|
||||
public CommandGiveItemDust(EpicEnchants plugin) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.songoda.epicenchants.command.commands;
|
||||
package com.songoda.epicenchants.commands;
|
||||
|
||||
import com.songoda.core.commands.AbstractCommand;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
@ -14,7 +14,7 @@ import java.util.stream.Collectors;
|
||||
public class CommandGiveRandomBook extends AbstractCommand {
|
||||
|
||||
private final EpicEnchants plugin;
|
||||
|
||||
|
||||
public CommandGiveRandomBook(EpicEnchants plugin) {
|
||||
super(false, "giverandombook");
|
||||
this.plugin = plugin;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.songoda.epicenchants.command.commands;
|
||||
package com.songoda.epicenchants.commands;
|
||||
|
||||
import com.songoda.core.commands.AbstractCommand;
|
||||
import com.songoda.epicenchants.CommandCommons;
|
||||
@ -14,7 +14,7 @@ import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class CommandGiveScroll extends AbstractCommand {
|
||||
|
||||
|
||||
private final EpicEnchants plugin;
|
||||
|
||||
public CommandGiveScroll(EpicEnchants plugin) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.songoda.epicenchants.command.commands;
|
||||
package com.songoda.epicenchants.commands;
|
||||
|
||||
import com.songoda.core.commands.AbstractCommand;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
@ -10,7 +10,7 @@ import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class CommandList extends AbstractCommand {
|
||||
|
||||
|
||||
private final EpicEnchants plugin;
|
||||
|
||||
public CommandList(EpicEnchants plugin) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.songoda.epicenchants.command.commands;
|
||||
package com.songoda.epicenchants.commands;
|
||||
|
||||
import com.songoda.core.commands.AbstractCommand;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.songoda.epicenchants.command.commands;
|
||||
package com.songoda.epicenchants.commands;
|
||||
|
||||
import com.songoda.core.commands.AbstractCommand;
|
||||
import com.songoda.core.configuration.editor.PluginConfigGui;
|
||||
@ -9,7 +9,7 @@ import org.bukkit.entity.Player;
|
||||
import java.util.List;
|
||||
|
||||
public class CommandSettings extends AbstractCommand {
|
||||
|
||||
|
||||
private final EpicEnchants plugin;
|
||||
|
||||
public CommandSettings(EpicEnchants plugin) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.songoda.epicenchants.command.commands;
|
||||
package com.songoda.epicenchants.commands;
|
||||
|
||||
import com.songoda.core.commands.AbstractCommand;
|
||||
import com.songoda.epicenchants.EpicEnchants;
|
||||
@ -9,7 +9,7 @@ import org.bukkit.entity.Player;
|
||||
import java.util.List;
|
||||
|
||||
public class CommandTinkerer extends AbstractCommand {
|
||||
|
||||
|
||||
private final EpicEnchants plugin;
|
||||
|
||||
public CommandTinkerer(EpicEnchants plugin) {
|
||||
|
@ -2,6 +2,7 @@ package com.songoda.epicenchants.effect.effects;
|
||||
|
||||
import com.songoda.epicenchants.effect.EffectExecutor;
|
||||
import com.songoda.epicenchants.enums.EventType;
|
||||
import com.songoda.epicenchants.objects.LeveledModifier;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -15,6 +16,8 @@ public class Explode extends EffectExecutor {
|
||||
|
||||
@Override
|
||||
public void execute(@NotNull Player user, @Nullable LivingEntity opponent, int level, EventType eventType) {
|
||||
consume(entity -> entity.getWorld().createExplosion(entity.getLocation(), getSection().getInt("magnitude")), user, opponent);
|
||||
consume(entity -> entity.getWorld().createExplosion(entity.getLocation(), (float) LeveledModifier
|
||||
.of(getSection().getString("magnitude")).get(level, level, user, opponent)),
|
||||
user, opponent);
|
||||
}
|
||||
}
|
||||
|
@ -60,12 +60,12 @@ public class EnchanterMenu extends FastInv {
|
||||
|
||||
if (EconomyManager.isEnabled()) {
|
||||
EconomyManager.withdrawBalance(player, ecoCost);
|
||||
instance.getLocale().getMessage("enchanter.success")
|
||||
event.getPlayer().sendMessage(instance.getLocale().getMessage("enchanter.success")
|
||||
.processPlaceholder("group_name", group.getName())
|
||||
.processPlaceholder("group_color", group.getColor())
|
||||
.processPlaceholder("eco_cost", ecoCost)
|
||||
.processPlaceholder("exp_cost", expCost)
|
||||
.sendPrefixedMessage(player);
|
||||
.getPrefixedMessage());
|
||||
}
|
||||
|
||||
changeExp(player, -expCost);
|
||||
|
@ -1,9 +1,9 @@
|
||||
package com.songoda.epicenchants.utils.single;
|
||||
|
||||
import com.songoda.core.math.MathUtils;
|
||||
import com.songoda.epicenchants.enums.EnchantResult;
|
||||
import com.songoda.epicenchants.enums.TriggerType;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
@ -14,9 +14,6 @@ import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptEngineManager;
|
||||
import javax.script.ScriptException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@ -25,7 +22,6 @@ import java.util.concurrent.ThreadLocalRandom;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class GeneralUtils {
|
||||
private static final ScriptEngine SCRIPT_ENGINE = new ScriptEngineManager().getEngineByName("JavaScript");
|
||||
|
||||
public static boolean chance(int chance) {
|
||||
return chance((double) chance);
|
||||
@ -72,10 +68,10 @@ public class GeneralUtils {
|
||||
|
||||
public static ItemStack getHeldItem(LivingEntity entity, Event event) {
|
||||
if (entity instanceof Player) {
|
||||
Player player = (Player)entity;
|
||||
Player player = (Player) entity;
|
||||
int slot = getHeldItemSlot(player, event);
|
||||
return player.getInventory().getItem(slot);
|
||||
} else if (entity.getEquipment() != null){
|
||||
} else if (entity.getEquipment() != null) {
|
||||
ItemStack item = entity.getEquipment().getItemInHand();
|
||||
|
||||
try {
|
||||
@ -90,7 +86,7 @@ public class GeneralUtils {
|
||||
}
|
||||
|
||||
public static int getHeldItemSlot(Player entity, Event event) {
|
||||
Player player = (Player)entity;
|
||||
Player player = (Player) entity;
|
||||
int slot = player.getInventory().getHeldItemSlot();
|
||||
|
||||
try {
|
||||
@ -104,12 +100,7 @@ public class GeneralUtils {
|
||||
}
|
||||
|
||||
public static Object parseJS(String toParse, String type, Object def) {
|
||||
try {
|
||||
return SCRIPT_ENGINE.eval(toParse);
|
||||
} catch (ScriptException e) {
|
||||
Bukkit.getLogger().warning("[EpicEnchants] One of your " + type + " expressions is not properly formatted.");
|
||||
Bukkit.getLogger().warning(toParse);
|
||||
return def;
|
||||
}
|
||||
return MathUtils.eval("[EpicEnchants] One of your " + type + " expressions is not properly formatted.", toParse);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,9 @@ command:
|
||||
whitescroll:
|
||||
received: '&7You have been given a whitescroll.'
|
||||
gave: '&7You gave &6{player} &7a whitescroll.'
|
||||
blackscroll:
|
||||
received: '&7You have been given a blackscroll.'
|
||||
gave: '&7You gave &6{player} &7a blackscroll.'
|
||||
apply:
|
||||
invaliditem: '&cYou cannot apply &4{enchant}&r &cto this item.'
|
||||
reload: '&7Configuration files reloaded.'
|
||||
|
Loading…
Reference in New Issue
Block a user