Small Fixes

This commit is contained in:
Auxilor
2020-09-12 10:36:01 +01:00
parent bfee7b00d2
commit 3ae6867146
13 changed files with 20 additions and 12 deletions

View File

@@ -3,6 +3,7 @@ package com.willfp.ecoenchants.commands;
import com.willfp.ecoenchants.EcoEnchantsPlugin;
import com.willfp.ecoenchants.config.ConfigManager;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.nms.Cooldown;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;

View File

@@ -3,7 +3,9 @@ package com.willfp.ecoenchants.display;
import com.comphenix.protocol.PacketType;
import com.comphenix.protocol.events.PacketAdapter;
import com.comphenix.protocol.events.PacketEvent;
import com.comphenix.protocol.wrappers.EnumWrappers;
import com.willfp.ecoenchants.EcoEnchantsPlugin;
import org.bukkit.Bukkit;
import org.bukkit.inventory.MerchantRecipe;
import java.util.Arrays;

View File

@@ -133,8 +133,6 @@ public class EnchantDisplay {
if(!EnchantmentTarget.ALL.contains(item.getType()))
return oldItem;
item = revertDisplay(item);
ItemMeta meta = item.getItemMeta();
List<String> itemLore = new ArrayList<>();
@@ -142,6 +140,8 @@ public class EnchantDisplay {
if(meta == null) return oldItem;
item = revertDisplay(item);
if(meta.getPersistentDataContainer().has(keySkip, PersistentDataType.INTEGER))
return oldItem;

View File

@@ -5,6 +5,7 @@ import com.willfp.ecoenchants.enchantments.EcoEnchantBuilder;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.util.checks.EnchantChecks;
import com.willfp.ecoenchants.integrations.antigrief.AntigriefManager;
import com.willfp.ecoenchants.util.VectorUtils;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@@ -42,6 +43,9 @@ public class Grapple extends EcoEnchant {
double baseMultiplier = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "velocity-multiplier");
Vector vector = player.getLocation().toVector().clone().subtract(victim.getLocation().toVector()).normalize().multiply(level * baseMultiplier);
victim.setVelocity(vector);
if(VectorUtils.isFinite(vector)) {
victim.setVelocity(vector);
}
}
}