Launch check
This commit is contained in:
@@ -4,6 +4,7 @@ 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.VelocityChecks;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@@ -55,6 +56,10 @@ public class Launch extends EcoEnchant {
|
||||
double multiplier = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "multiplier");
|
||||
double boost = 1 + (multiplier * level);
|
||||
|
||||
if (VelocityChecks.isUnsafeVelocity(player.getVelocity().multiply(boost))) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.getPlugin().getScheduler().run(() -> player.setVelocity(player.getVelocity().multiply(boost)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user