Updated to eco 3.8.0 and removed unneeded code

This commit is contained in:
Auxilor 2021-02-16 20:14:48 +00:00
parent ca1b870491
commit 9787cde593
57 changed files with 70 additions and 361 deletions

View File

@ -49,7 +49,7 @@ allprojects {
}
dependencies {
compileOnly 'com.willfp:eco:3.6.0'
compileOnly 'com.willfp:eco:3.8.0'
compileOnly 'org.jetbrains:annotations:19.0.0'

View File

@ -1,19 +0,0 @@
package com.willfp.ecoenchants.proxy.v1_15_R1;
import com.willfp.ecoenchants.proxy.proxies.BlockBreakProxy;
import net.minecraft.server.v1_15_R1.BlockPosition;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
public final class BlockBreak implements BlockBreakProxy {
@Override
public void breakBlock(@NotNull final Player player,
@NotNull final Block block) {
if (block.getY() > 255 || block.getY() < 0) {
return;
}
((CraftPlayer) player).getHandle().playerInteractManager.breakBlock(new BlockPosition(block.getX(), block.getY(), block.getZ()));
}
}

View File

@ -1,15 +0,0 @@
package com.willfp.ecoenchants.proxy.v1_15_R1;
import com.willfp.ecoenchants.proxy.proxies.CooldownProxy;
import net.minecraft.server.v1_15_R1.EntityHuman;
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
public final class Cooldown implements CooldownProxy {
@Override
public double getAttackCooldown(@NotNull final Player player) {
EntityHuman entityHuman = ((CraftPlayer) player).getHandle();
return entityHuman.s(0);
}
}

View File

@ -1,17 +0,0 @@
package com.willfp.ecoenchants.proxy.v1_15_R1;
import com.willfp.ecoenchants.proxy.proxies.TridentStackProxy;
import net.minecraft.server.v1_15_R1.EntityThrownTrident;
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftTrident;
import org.bukkit.craftbukkit.v1_15_R1.inventory.CraftItemStack;
import org.bukkit.entity.Trident;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
public final class TridentStack implements TridentStackProxy {
@Override
public ItemStack getTridentStack(@NotNull final Trident trident) {
EntityThrownTrident t = ((CraftTrident) trident).getHandle();
return CraftItemStack.asBukkitCopy(t.trident);
}
}

View File

@ -1,19 +0,0 @@
package com.willfp.ecoenchants.proxy.v1_16_R1;
import com.willfp.ecoenchants.proxy.proxies.BlockBreakProxy;
import net.minecraft.server.v1_16_R1.BlockPosition;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.v1_16_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
public final class BlockBreak implements BlockBreakProxy {
@Override
public void breakBlock(@NotNull final Player player,
@NotNull final Block block) {
if (block.getY() > 255 || block.getY() < 0) {
return;
}
((CraftPlayer) player).getHandle().playerInteractManager.breakBlock(new BlockPosition(block.getX(), block.getY(), block.getZ()));
}
}

View File

@ -1,12 +0,0 @@
package com.willfp.ecoenchants.proxy.v1_16_R1;
import com.willfp.ecoenchants.proxy.proxies.CooldownProxy;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
public final class Cooldown implements CooldownProxy {
@Override
public double getAttackCooldown(@NotNull final Player player) {
return player.getAttackCooldown();
}
}

View File

@ -1,17 +0,0 @@
package com.willfp.ecoenchants.proxy.v1_16_R1;
import com.willfp.ecoenchants.proxy.proxies.TridentStackProxy;
import net.minecraft.server.v1_16_R1.EntityThrownTrident;
import org.bukkit.craftbukkit.v1_16_R1.entity.CraftTrident;
import org.bukkit.craftbukkit.v1_16_R1.inventory.CraftItemStack;
import org.bukkit.entity.Trident;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
public final class TridentStack implements TridentStackProxy {
@Override
public ItemStack getTridentStack(@NotNull final Trident trident) {
EntityThrownTrident t = ((CraftTrident) trident).getHandle();
return CraftItemStack.asBukkitCopy(t.trident);
}
}

View File

@ -1,19 +0,0 @@
package com.willfp.ecoenchants.proxy.v1_16_R2;
import com.willfp.ecoenchants.proxy.proxies.BlockBreakProxy;
import net.minecraft.server.v1_16_R2.BlockPosition;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.v1_16_R2.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
public final class BlockBreak implements BlockBreakProxy {
@Override
public void breakBlock(@NotNull final Player player,
@NotNull final Block block) {
if (block.getY() > 255 || block.getY() < 0) {
return;
}
((CraftPlayer) player).getHandle().playerInteractManager.breakBlock(new BlockPosition(block.getX(), block.getY(), block.getZ()));
}
}

View File

@ -1,12 +0,0 @@
package com.willfp.ecoenchants.proxy.v1_16_R2;
import com.willfp.ecoenchants.proxy.proxies.CooldownProxy;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
public final class Cooldown implements CooldownProxy {
@Override
public double getAttackCooldown(@NotNull final Player player) {
return player.getAttackCooldown();
}
}

View File

@ -1,17 +0,0 @@
package com.willfp.ecoenchants.proxy.v1_16_R2;
import com.willfp.ecoenchants.proxy.proxies.TridentStackProxy;
import net.minecraft.server.v1_16_R2.EntityThrownTrident;
import org.bukkit.craftbukkit.v1_16_R2.entity.CraftTrident;
import org.bukkit.craftbukkit.v1_16_R2.inventory.CraftItemStack;
import org.bukkit.entity.Trident;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
public final class TridentStack implements TridentStackProxy {
@Override
public ItemStack getTridentStack(@NotNull final Trident trident) {
EntityThrownTrident t = ((CraftTrident) trident).getHandle();
return CraftItemStack.asBukkitCopy(t.trident);
}
}

View File

@ -1,19 +0,0 @@
package com.willfp.ecoenchants.proxy.v1_16_R3;
import com.willfp.ecoenchants.proxy.proxies.BlockBreakProxy;
import net.minecraft.server.v1_16_R3.BlockPosition;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
public final class BlockBreak implements BlockBreakProxy {
@Override
public void breakBlock(@NotNull final Player player,
@NotNull final Block block) {
if (block.getY() > 255 || block.getY() < 0) {
return;
}
((CraftPlayer) player).getHandle().playerInteractManager.breakBlock(new BlockPosition(block.getX(), block.getY(), block.getZ()));
}
}

View File

@ -1,12 +0,0 @@
package com.willfp.ecoenchants.proxy.v1_16_R3;
import com.willfp.ecoenchants.proxy.proxies.CooldownProxy;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
public final class Cooldown implements CooldownProxy {
@Override
public double getAttackCooldown(@NotNull final Player player) {
return player.getAttackCooldown();
}
}

View File

@ -1,17 +0,0 @@
package com.willfp.ecoenchants.proxy.v1_16_R3;
import com.willfp.ecoenchants.proxy.proxies.TridentStackProxy;
import net.minecraft.server.v1_16_R3.EntityThrownTrident;
import org.bukkit.craftbukkit.v1_16_R3.entity.CraftTrident;
import org.bukkit.craftbukkit.v1_16_R3.inventory.CraftItemStack;
import org.bukkit.entity.Trident;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
public final class TridentStack implements TridentStackProxy {
@Override
public ItemStack getTridentStack(@NotNull final Trident trident) {
EntityThrownTrident t = ((CraftTrident) trident).getHandle();
return CraftItemStack.asBukkitCopy(t.trident);
}
}

View File

@ -2,10 +2,9 @@ package com.willfp.ecoenchants.command.commands;
import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.events.ListenerPriority;
import com.willfp.eco.util.proxy.ProxyConstants;
import com.willfp.eco.util.command.AbstractCommand;
import com.willfp.eco.util.drops.internal.DropManager;
import com.willfp.eco.util.plugin.AbstractEcoPlugin;
import com.willfp.eco.util.proxy.ProxyConstants;
import com.willfp.ecoenchants.display.EnchantmentCache;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
@ -111,9 +110,6 @@ public class CommandEcodebug extends AbstractCommand {
this.getPlugin().getLog().info("Enchantments with evident issues: " + withIssues.toString());
this.getPlugin().getLog().info("");
this.getPlugin().getLog().info("Drop Type: " + DropManager.getType());
this.getPlugin().getLog().info("");
this.getPlugin().getLog().info("Packets: " + ProtocolLibrary.getProtocolManager().getPacketListeners().stream()
.filter(packetListener -> packetListener.getSendingWhitelist().getPriority().equals(ListenerPriority.MONITOR))
.collect(Collectors.toList()).toString());

View File

@ -1,7 +1,6 @@
package com.willfp.ecoenchants.config.configs;
import com.willfp.eco.util.config.BaseConfig;
import com.willfp.eco.util.plugin.AbstractEcoPlugin;
import com.willfp.ecoenchants.EcoEnchantsPlugin;
import java.util.Set;

View File

@ -1,7 +1,6 @@
package com.willfp.ecoenchants.config.configs;
import com.willfp.eco.util.config.BaseConfig;
import com.willfp.eco.util.plugin.AbstractEcoPlugin;
import com.willfp.ecoenchants.EcoEnchantsPlugin;
import org.bukkit.Material;
import org.jetbrains.annotations.NotNull;

View File

@ -1,11 +1,10 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.eco.util.DurabilityUtils;
import com.willfp.eco.util.PlayerUtils;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.proxy.proxies.CooldownProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
@ -32,7 +31,7 @@ public class Abrasion extends EcoEnchant {
Player victim = (Player) uncastVictim;
boolean notcharged = this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "allow-not-fully-charged");
if (attacker instanceof Player && ProxyUtils.getProxy(CooldownProxy.class).getAttackCooldown((Player) attacker) != 1.0f && !notcharged) {
if (attacker instanceof Player && PlayerUtils.getAttackCooldown((Player) attacker) != 1.0f && !notcharged) {
return;
}

View File

@ -1,12 +1,11 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.eco.util.BlockUtils;
import com.willfp.eco.util.integrations.anticheat.AnticheatManager;
import com.willfp.eco.util.integrations.antigrief.AntigriefManager;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.proxy.proxies.BlockBreakProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.Particle;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
@ -72,7 +71,7 @@ public class BlastMining extends EcoEnchant {
toBreak.forEach((block1 -> {
block1.setMetadata("block-ignore", this.getPlugin().getMetadataValueFactory().create(true));
ProxyUtils.getProxy(BlockBreakProxy.class).breakBlock(player, block1);
BlockUtils.breakBlock(player, block1);
block1.removeMetadata("block-ignore", this.getPlugin());
}));

View File

@ -1,11 +1,10 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.eco.util.PlayerUtils;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils;
import com.willfp.ecoenchants.proxy.proxies.CooldownProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
@ -26,7 +25,7 @@ public class Bleed extends EcoEnchant {
final int level,
@NotNull final EntityDamageByEntityEvent event) {
if (attacker instanceof Player
&& ProxyUtils.getProxy(CooldownProxy.class).getAttackCooldown((Player) attacker) != 1.0f
&& PlayerUtils.getAttackCooldown((Player) attacker) != 1.0f
&& !this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "allow-not-fully-charged")) {
return;
}

View File

@ -1,10 +1,9 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.eco.util.PlayerUtils;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.proxy.proxies.CooldownProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
@ -26,7 +25,7 @@ public class Cleave extends EcoEnchant {
}
if (attacker instanceof Player
&& ProxyUtils.getProxy(CooldownProxy.class).getAttackCooldown((Player) attacker) != 1.0f
&& PlayerUtils.getAttackCooldown((Player) attacker) != 1.0f
&& !this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "allow-not-fully-charged")) {
return;
}

View File

@ -1,11 +1,10 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.eco.util.PlayerUtils;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils;
import com.willfp.ecoenchants.proxy.proxies.CooldownProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
@ -26,7 +25,7 @@ public class Disable extends EcoEnchant {
final int level,
@NotNull final EntityDamageByEntityEvent event) {
if (attacker instanceof Player
&& ProxyUtils.getProxy(CooldownProxy.class).getAttackCooldown((Player) attacker) != 1.0f
&& PlayerUtils.getAttackCooldown((Player) attacker) != 1.0f
&& !this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "allow-not-fully-charged")) {
return;
}

View File

@ -1,13 +1,12 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.eco.util.BlockUtils;
import com.willfp.eco.util.VectorUtils;
import com.willfp.eco.util.integrations.anticheat.AnticheatManager;
import com.willfp.eco.util.integrations.antigrief.AntigriefManager;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.proxy.proxies.BlockBreakProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.block.BlockBreakEvent;
@ -54,7 +53,7 @@ public class Drill extends EcoEnchant {
continue;
}
ProxyUtils.getProxy(BlockBreakProxy.class).breakBlock(player, block1);
BlockUtils.breakBlock(player, block1);
block1.removeMetadata("block-ignore", this.getPlugin());
}

View File

@ -1,11 +1,10 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.eco.util.PlayerUtils;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils;
import com.willfp.ecoenchants.proxy.proxies.CooldownProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
@ -25,7 +24,7 @@ public class Dullness extends EcoEnchant {
final int level,
@NotNull final EntityDamageByEntityEvent event) {
if (attacker instanceof Player
&& ProxyUtils.getProxy(CooldownProxy.class).getAttackCooldown((Player) attacker) != 1.0f
&& PlayerUtils.getAttackCooldown((Player) attacker) != 1.0f
&& !this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "allow-not-fully-charged")) {
return;
}

View File

@ -1,11 +1,10 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.eco.util.PlayerUtils;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils;
import com.willfp.ecoenchants.proxy.proxies.CooldownProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
@ -26,7 +25,7 @@ public class Famine extends EcoEnchant {
final int level,
@NotNull final EntityDamageByEntityEvent event) {
if (attacker instanceof Player
&& ProxyUtils.getProxy(CooldownProxy.class).getAttackCooldown((Player) attacker) != 1.0f
&& PlayerUtils.getAttackCooldown((Player) attacker) != 1.0f
&& !this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "allow-not-fully-charged")) {
return;
}

View File

@ -1,12 +1,11 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.eco.util.PlayerUtils;
import com.willfp.eco.util.VectorUtils;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils;
import com.willfp.ecoenchants.proxy.proxies.CooldownProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Monster;
@ -28,7 +27,7 @@ public class Fury extends EcoEnchant {
final int level,
@NotNull final EntityDamageByEntityEvent event) {
if (attacker instanceof Player
&& ProxyUtils.getProxy(CooldownProxy.class).getAttackCooldown((Player) attacker) != 1.0f
&& PlayerUtils.getAttackCooldown((Player) attacker) != 1.0f
&& !this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "allow-not-fully-charged")) {
return;
}

View File

@ -1,11 +1,10 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.eco.util.PlayerUtils;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils;
import com.willfp.ecoenchants.proxy.proxies.CooldownProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
@ -26,7 +25,7 @@ public class IllusionAspect extends EcoEnchant {
final int level,
@NotNull final EntityDamageByEntityEvent event) {
if (attacker instanceof Player
&& ProxyUtils.getProxy(CooldownProxy.class).getAttackCooldown((Player) attacker) != 1.0f
&& PlayerUtils.getAttackCooldown((Player) attacker) != 1.0f
&& !this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "allow-not-fully-charged")) {
return;
}

View File

@ -2,7 +2,7 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.eco.util.drops.DropQueue;
import com.willfp.eco.util.integrations.antigrief.AntigriefManager;
import com.willfp.eco.util.tuplets.Pair;
import com.willfp.eco.util.tuples.Pair;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;

View File

@ -6,8 +6,6 @@ import com.willfp.eco.util.integrations.antigrief.AntigriefManager;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.proxy.proxies.BlockBreakProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
@ -58,7 +56,7 @@ public class Lumberjack extends EcoEnchant {
continue;
}
ProxyUtils.getProxy(BlockBreakProxy.class).breakBlock(player, treeBlock);
BlockUtils.breakBlock(player, treeBlock);
this.getPlugin().getScheduler().runLater(() -> treeBlock.removeMetadata("block-ignore", this.getPlugin()), 1);
}

View File

@ -1,11 +1,10 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.eco.util.TridentUtils;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.enchantments.util.EnchantChecks;
import com.willfp.ecoenchants.proxy.proxies.TridentStackProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.entity.AbstractArrow;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
@ -36,7 +35,7 @@ public class Shockwave extends EcoEnchant {
AbstractArrow entity = (AbstractArrow) event.getEntity();
ItemStack item = player.getInventory().getItemInMainHand();
if (entity instanceof Trident) {
item = ProxyUtils.getProxy(TridentStackProxy.class).getTridentStack((Trident) entity);
item = TridentUtils.getItemStack((Trident) entity);
}
if (!EnchantChecks.item(item, this)) {

View File

@ -1,14 +1,13 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.eco.util.NumberUtils;
import com.willfp.eco.util.TridentUtils;
import com.willfp.eco.util.drops.DropQueue;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.enchantments.util.EnchantChecks;
import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils;
import com.willfp.ecoenchants.proxy.proxies.TridentStackProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
@ -56,7 +55,7 @@ public class Spearfishing extends EcoEnchant {
return;
}
ItemStack item = ProxyUtils.getProxy(TridentStackProxy.class).getTridentStack(trident);
ItemStack item = TridentUtils.getItemStack(trident);
if (!EnchantChecks.item(item, this)) {
return;

View File

@ -1,12 +1,11 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.eco.util.TridentUtils;
import com.willfp.eco.util.integrations.antigrief.AntigriefManager;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.enchantments.util.EnchantChecks;
import com.willfp.ecoenchants.proxy.proxies.TridentStackProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.Bukkit;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
@ -45,7 +44,7 @@ public class Splash extends EcoEnchant {
Trident trident = (Trident) event.getEntity();
Player player = (Player) event.getEntity().getShooter();
ItemStack item = ProxyUtils.getProxy(TridentStackProxy.class).getTridentStack(trident);
ItemStack item = TridentUtils.getItemStack(trident);
if (!EnchantChecks.item(item, this)) {
return;

View File

@ -1,11 +1,10 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.eco.util.PlayerUtils;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils;
import com.willfp.ecoenchants.proxy.proxies.CooldownProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
@ -26,7 +25,7 @@ public class StrayAspect extends EcoEnchant {
final int level,
@NotNull final EntityDamageByEntityEvent event) {
if (attacker instanceof Player
&& ProxyUtils.getProxy(CooldownProxy.class).getAttackCooldown((Player) attacker) != 1.0f
&& PlayerUtils.getAttackCooldown((Player) attacker) != 1.0f
&& !this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "allow-not-fully-charged")) {
return;
}

View File

@ -1,11 +1,10 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.eco.util.PlayerUtils;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils;
import com.willfp.ecoenchants.proxy.proxies.CooldownProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
@ -24,7 +23,7 @@ public class Supercritical extends EcoEnchant {
final int level,
@NotNull final EntityDamageByEntityEvent event) {
if (attacker instanceof Player
&& ProxyUtils.getProxy(CooldownProxy.class).getAttackCooldown((Player) attacker) != 1.0f
&& PlayerUtils.getAttackCooldown((Player) attacker) != 1.0f
&& !this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "allow-not-fully-charged")) {
return;
}

View File

@ -1,5 +1,6 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.eco.util.TridentUtils;
import com.willfp.eco.util.drops.DropQueue;
import com.willfp.eco.util.events.entitydeathbyentity.EntityDeathByEntityEvent;
import com.willfp.eco.util.integrations.antigrief.AntigriefManager;
@ -8,8 +9,6 @@ import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.enchantments.util.EnchantChecks;
import com.willfp.ecoenchants.proxy.proxies.TridentStackProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.block.Block;
@ -153,7 +152,7 @@ public class Telekinesis extends EcoEnchant {
} else if (event.getKiller() instanceof Trident) {
if (((Trident) event.getKiller()).getShooter() instanceof Player) {
player = (Player) ((Trident) event.getKiller()).getShooter();
item = ProxyUtils.getProxy(TridentStackProxy.class).getTridentStack((Trident) event.getKiller());
item = TridentUtils.getItemStack((Trident) event.getKiller());
}
}

View File

@ -1,12 +1,11 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.eco.util.LightningUtils;
import com.willfp.eco.util.PlayerUtils;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils;
import com.willfp.ecoenchants.proxy.proxies.CooldownProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
@ -25,7 +24,7 @@ public class Thor extends EcoEnchant {
final int level,
@NotNull final EntityDamageByEntityEvent event) {
if (attacker instanceof Player
&& ProxyUtils.getProxy(CooldownProxy.class).getAttackCooldown((Player) attacker) != 1.0f
&& PlayerUtils.getAttackCooldown((Player) attacker) != 1.0f
&& !this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "allow-not-fully-charged")) {
return;
}

View File

@ -1,11 +1,10 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.eco.util.PlayerUtils;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils;
import com.willfp.ecoenchants.proxy.proxies.CooldownProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
@ -26,7 +25,7 @@ public class Toxic extends EcoEnchant {
final int level,
@NotNull final EntityDamageByEntityEvent event) {
if (attacker instanceof Player
&& ProxyUtils.getProxy(CooldownProxy.class).getAttackCooldown((Player) attacker) != 1.0f
&& PlayerUtils.getAttackCooldown((Player) attacker) != 1.0f
&& !this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "allow-not-fully-charged")) {
return;
}

View File

@ -1,11 +1,10 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.eco.util.PlayerUtils;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils;
import com.willfp.ecoenchants.proxy.proxies.CooldownProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
@ -26,7 +25,7 @@ public class VampireAspect extends EcoEnchant {
final int level,
@NotNull final EntityDamageByEntityEvent event) {
if (attacker instanceof Player
&& ProxyUtils.getProxy(CooldownProxy.class).getAttackCooldown((Player) attacker) != 1.0f
&& PlayerUtils.getAttackCooldown((Player) attacker) != 1.0f
&& !this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "allow-not-fully-charged")) {
return;
}

View File

@ -6,8 +6,6 @@ import com.willfp.eco.util.integrations.antigrief.AntigriefManager;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.proxy.proxies.BlockBreakProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
@ -58,7 +56,7 @@ public class Vein extends EcoEnchant {
continue;
}
ProxyUtils.getProxy(BlockBreakProxy.class).breakBlock(player, veinBlock);
BlockUtils.breakBlock(player, veinBlock);
this.getPlugin().getScheduler().runLater(() -> veinBlock.removeMetadata("block-ignore", this.getPlugin()), 1);
}

View File

@ -1,12 +1,11 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.special;
import com.willfp.eco.util.LightningUtils;
import com.willfp.eco.util.PlayerUtils;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils;
import com.willfp.ecoenchants.proxy.proxies.CooldownProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
@ -25,7 +24,7 @@ public class Bolt extends EcoEnchant {
final int level,
@NotNull final EntityDamageByEntityEvent event) {
if (attacker instanceof Player
&& ProxyUtils.getProxy(CooldownProxy.class).getAttackCooldown((Player) attacker) != 1.0f
&& PlayerUtils.getAttackCooldown((Player) attacker) != 1.0f
&& !this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "allow-not-fully-charged")) {
return;
}

View File

@ -1,10 +1,9 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.special;
import com.willfp.eco.util.PlayerUtils;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.proxy.proxies.CooldownProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
@ -32,7 +31,7 @@ public class Carve extends EcoEnchant {
final double radius = radiusPerLevel * level;
if (attacker instanceof Player
&& ProxyUtils.getProxy(CooldownProxy.class).getAttackCooldown((Player) attacker) != 1.0
&& PlayerUtils.getAttackCooldown((Player) attacker) != 1.0
&& !this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "allow-not-fully-charged")) {
return;
}

View File

@ -1,11 +1,10 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.special;
import com.willfp.eco.util.PlayerUtils;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils;
import com.willfp.ecoenchants.proxy.proxies.CooldownProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
@ -33,7 +32,7 @@ public class Confusion extends EcoEnchant {
Player victim = (Player) uncastVictim;
if (attacker instanceof Player
&& ProxyUtils.getProxy(CooldownProxy.class).getAttackCooldown((Player) attacker) != 1.0f
&& PlayerUtils.getAttackCooldown((Player) attacker) != 1.0f
&& !this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "allow-not-fully-charged")) {
return;
}

View File

@ -1,10 +1,9 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.special;
import com.willfp.eco.util.PlayerUtils;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.proxy.proxies.CooldownProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
@ -26,7 +25,7 @@ public class Razor extends EcoEnchant {
double baseDamage = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "base-damage");
double extra = (level * perLevelMultiplier) + baseDamage;
if (this.getConfig().getBool((EcoEnchants.CONFIG_LOCATION) + "decrease-if-cooldown") && attacker instanceof Player) {
extra *= ProxyUtils.getProxy(CooldownProxy.class).getAttackCooldown((Player) attacker);
extra *= PlayerUtils.getAttackCooldown((Player) attacker);
}
event.setDamage(event.getDamage() + extra);

View File

@ -1,12 +1,11 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.special;
import com.willfp.eco.util.PlayerUtils;
import com.willfp.eco.util.integrations.antigrief.AntigriefManager;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils;
import com.willfp.ecoenchants.proxy.proxies.CooldownProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.Location;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
@ -31,7 +30,7 @@ public class Volatile extends EcoEnchant {
Player attacker = (Player) uncastAttacker;
if (ProxyUtils.getProxy(CooldownProxy.class).getAttackCooldown(attacker) != 1.0f
if (PlayerUtils.getAttackCooldown(attacker) != 1.0f
&& !this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "allow-not-fully-charged")) {
return;
}

View File

@ -1,11 +1,10 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.spell;
import com.willfp.eco.util.BlockUtils;
import com.willfp.eco.util.integrations.anticheat.AnticheatManager;
import com.willfp.eco.util.integrations.antigrief.AntigriefManager;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.itemtypes.Spell;
import com.willfp.ecoenchants.proxy.proxies.BlockBreakProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.Particle;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
@ -75,7 +74,7 @@ public class Dynamite extends Spell {
toBreak.forEach((block1 -> {
block1.setMetadata("block-ignore", this.getPlugin().getMetadataValueFactory().create(true));
ProxyUtils.getProxy(BlockBreakProxy.class).breakBlock(player, block1);
BlockUtils.breakBlock(player, block1);
block1.removeMetadata("block-ignore", this.getPlugin());
}));

View File

@ -2,13 +2,12 @@ package com.willfp.ecoenchants.enchantments.itemtypes;
import com.google.common.util.concurrent.AtomicDouble;
import com.willfp.eco.util.NumberUtils;
import com.willfp.eco.util.TridentUtils;
import com.willfp.eco.util.optional.Prerequisite;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.enchantments.util.EnchantChecks;
import com.willfp.ecoenchants.proxy.proxies.TridentStackProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.Location;
import org.bukkit.Particle;
import org.bukkit.block.Block;
@ -202,7 +201,7 @@ public abstract class Artifact extends EcoEnchant {
AbstractArrow entity = (AbstractArrow) event.getEntity();
ItemStack item = player.getInventory().getItemInMainHand();
if (entity instanceof Trident) {
item = ProxyUtils.getProxy(TridentStackProxy.class).getTridentStack((Trident) entity);
item = TridentUtils.getItemStack((Trident) entity);
}
if (!EnchantChecks.item(item, this)) {

View File

@ -2,7 +2,6 @@ package com.willfp.ecoenchants.enchantments.meta;
import com.google.common.collect.ImmutableList;
import com.willfp.eco.util.config.updating.annotations.ConfigUpdater;
import com.willfp.eco.util.plugin.AbstractEcoPlugin;
import com.willfp.ecoenchants.EcoEnchantsPlugin;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.itemtypes.Artifact;

View File

@ -4,7 +4,7 @@ import com.willfp.eco.util.NumberUtils;
import com.willfp.eco.util.internal.PluginDependent;
import com.willfp.eco.util.plugin.AbstractEcoPlugin;
import com.willfp.eco.util.proxy.ProxyConstants;
import com.willfp.eco.util.tuplets.Pair;
import com.willfp.eco.util.tuples.Pair;
import com.willfp.ecoenchants.proxy.proxies.OpenInventoryProxy;
import com.willfp.ecoenchants.proxy.proxies.RepairCostProxy;
import com.willfp.ecoenchants.util.ProxyUtils;

View File

@ -1,7 +1,7 @@
package com.willfp.ecoenchants.enchantments.support.merging.anvil;
import com.willfp.eco.util.StringUtils;
import com.willfp.eco.util.tuplets.Pair;
import com.willfp.eco.util.tuples.Pair;
import com.willfp.ecoenchants.EcoEnchantsPlugin;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;

View File

@ -5,7 +5,6 @@ import com.willfp.eco.util.DurabilityUtils;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.proxy.proxies.FastGetEnchantsProxy;
import com.willfp.ecoenchants.proxy.proxies.RepairCostProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import lombok.experimental.UtilityClass;
import org.bukkit.Material;

View File

@ -1,14 +1,13 @@
package com.willfp.ecoenchants.enchantments.util;
import com.google.common.collect.Sets;
import com.willfp.eco.util.TridentUtils;
import com.willfp.eco.util.events.armorequip.ArmorEquipEvent;
import com.willfp.eco.util.integrations.antigrief.AntigriefManager;
import com.willfp.eco.util.integrations.mcmmo.McmmoManager;
import com.willfp.eco.util.internal.PluginDependent;
import com.willfp.eco.util.plugin.AbstractEcoPlugin;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.eco.util.integrations.mcmmo.McmmoManager;
import com.willfp.ecoenchants.proxy.proxies.TridentStackProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Arrow;
@ -148,7 +147,7 @@ public class WatcherTriggers extends PluginDependent implements Listener {
LivingEntity attacker = (LivingEntity) ((Trident) event.getDamager()).getShooter();
Trident trident = (Trident) event.getDamager();
ItemStack item = ProxyUtils.getProxy(TridentStackProxy.class).getTridentStack(trident);
ItemStack item = TridentUtils.getItemStack(trident);
LivingEntity victim = (LivingEntity) event.getEntity();
@ -414,7 +413,7 @@ public class WatcherTriggers extends PluginDependent implements Listener {
}
Trident trident = (Trident) event.getEntity();
ItemStack item = ProxyUtils.getProxy(TridentStackProxy.class).getTridentStack(trident);
ItemStack item = TridentUtils.getItemStack(trident);
LivingEntity shooter = (LivingEntity) event.getEntity().getShooter();
EnchantChecks.getEnchantsOnItem(item).forEach(((enchant, level) -> {
@ -590,7 +589,7 @@ public class WatcherTriggers extends PluginDependent implements Listener {
Trident trident = (Trident) event.getEntity();
LivingEntity shooter = (LivingEntity) trident.getShooter();
ItemStack item = ProxyUtils.getProxy(TridentStackProxy.class).getTridentStack(trident);
ItemStack item = TridentUtils.getItemStack(trident);
EnchantChecks.getEnchantsOnItem(item).forEach((enchant, level) -> {
if (event.isCancelled()) {

View File

@ -1,18 +0,0 @@
package com.willfp.ecoenchants.proxy.proxies;
import com.willfp.eco.util.proxy.AbstractProxy;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
public interface BlockBreakProxy extends AbstractProxy {
/**
* Break the block as if the player had done it manually.
*
* @param player The player to break the block as.
* @param block The block to break.
*/
void breakBlock(@NotNull Player player,
@NotNull Block block);
}

View File

@ -1,16 +0,0 @@
package com.willfp.ecoenchants.proxy.proxies;
import com.willfp.eco.util.proxy.AbstractProxy;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
public interface CooldownProxy extends AbstractProxy {
/**
* Get the attack cooldown for a player.
*
* @param player The player's attack cooldown.
* @return A value between 0 and 1, with 1 representing full power.
*/
double getAttackCooldown(@NotNull Player player);
}

View File

@ -1,17 +0,0 @@
package com.willfp.ecoenchants.proxy.proxies;
import com.willfp.eco.util.proxy.AbstractProxy;
import org.bukkit.entity.Trident;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
public interface TridentStackProxy extends AbstractProxy {
/**
* Get a trident's ItemStack.
*
* @param trident The trident to query.
* @return The trident's ItemStack.
*/
ItemStack getTridentStack(@NotNull Trident trident);
}

View File

@ -4,8 +4,6 @@ import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.mmo.integrations.mmo.MMOManager;
import com.willfp.ecoenchants.mmo.structure.MMOEnchantment;
import com.willfp.ecoenchants.proxy.proxies.CooldownProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
@ -23,7 +21,7 @@ public class Elixir extends MMOEnchantment {
Player pVictim = (Player) victim;
boolean notcharged = this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "allow-not-fully-charged");
if (ProxyUtils.getProxy(CooldownProxy.class).getAttackCooldown(pAttacker) != 1.0f && !notcharged)
if (PlayerUtils.getAttackCooldown(pAttacker) != 1.0f && !notcharged)
return;
double victimMana = MMOManager.getMana(pVictim);

View File

@ -4,8 +4,6 @@ import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.mmo.integrations.mmo.MMOManager;
import com.willfp.ecoenchants.mmo.structure.MMOEnchantment;
import com.willfp.ecoenchants.proxy.proxies.CooldownProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
@ -23,7 +21,7 @@ public class Motivate extends MMOEnchantment {
Player pVictim = (Player) victim;
boolean notcharged = this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "allow-not-fully-charged");
if (ProxyUtils.getProxy(CooldownProxy.class).getAttackCooldown(pAttacker) != 1.0f && !notcharged)
if (PlayerUtils.getAttackCooldown(pVictim) != 1.0f && !notcharged)
return;
double victimStamina = MMOManager.getStamina(pVictim);

View File

@ -1,12 +1,11 @@
package com.willfp.ecoenchants.precision;
import com.willfp.eco.util.TridentUtils;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.enchantments.util.EnchantChecks;
import com.willfp.ecoenchants.proxy.proxies.TridentStackProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.GameMode;
import org.bukkit.entity.Enderman;
import org.bukkit.entity.LivingEntity;
@ -46,7 +45,7 @@ public class Precision extends EcoEnchant {
Player player = (Player) event.getEntity().getShooter();
Trident trident = (Trident) event.getEntity();
ItemStack itemStack = ProxyUtils.getProxy(TridentStackProxy.class).getTridentStack(trident);
ItemStack itemStack = TridentUtils.getItemStack(trident);
if (!EnchantChecks.item(itemStack, this)) {
return;
}

View File

@ -1,13 +1,12 @@
package com.willfp.ecoenchants.summoning;
import com.willfp.eco.util.NumberUtils;
import com.willfp.eco.util.PlayerUtils;
import com.willfp.eco.util.optional.Prerequisite;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils;
import com.willfp.ecoenchants.proxy.proxies.CooldownProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.attribute.Attribute;
@ -81,7 +80,7 @@ public abstract class SummoningEnchantment extends EcoEnchant {
final int level) {
if (summoningType.equals(SummoningType.MELEE)
&& attacker instanceof Player && ProxyUtils.getProxy(CooldownProxy.class).getAttackCooldown((Player) attacker) != 1.0f
&& attacker instanceof Player && PlayerUtils.getAttackCooldown((Player) attacker) != 1.0f
&& !this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "allow-not-fully-charged")) {
return;
}