Added Charge

This commit is contained in:
Auxilor
2020-11-07 13:53:54 +00:00
parent 2fbef163c2
commit c7d164892c
3 changed files with 47 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ import com.willfp.ecoenchants.enchantments.ecoenchants.curse.MisfortuneCurse;
import com.willfp.ecoenchants.enchantments.ecoenchants.curse.PermanenceCurse;
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.*;
import com.willfp.ecoenchants.enchantments.ecoenchants.special.*;
import com.willfp.ecoenchants.enchantments.ecoenchants.spell.Charge;
import com.willfp.ecoenchants.enchantments.ecoenchants.spell.Dynamite;
import com.willfp.ecoenchants.enchantments.ecoenchants.spell.Missile;
import com.willfp.ecoenchants.enchantments.ecoenchants.spell.Quake;
@@ -255,6 +256,7 @@ public class EcoEnchants {
public static final EcoEnchant QUAKE = new Quake();
public static final EcoEnchant VITALIZE = new Vitalize();
public static final EcoEnchant DYNAMITE = new Dynamite();
public static final EcoEnchant CHARGE = new Charge();
/**
* Get all registered {@link EcoEnchant}s

View File

@@ -0,0 +1,21 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.spell;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.itemtypes.Spell;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.util.Vector;
public class Charge extends Spell {
public Charge() {
super("charge");
}
@Override
public void onRightClick(Player player, int level, PlayerInteractEvent event) {
Vector velocity = player.getEyeLocation().getDirection().clone();
velocity.multiply(level * this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "velocity-per-level"));
velocity.setY(0.2);
player.setVelocity(velocity);
}
}

View File

@@ -0,0 +1,24 @@
#
# Charge EcoEnchant
#
name: "Charge"
description: Launches you in the direction you're looking.
enabled: true
obtaining:
table: true
villager: true
loot: true
rarity: legendary
general-config:
targets:
- sword
grindstoneable: true
conflicts: []
maximum-level: 6
config:
activation-sound: ENTITY_FIREWORK_ROCKET_LAUNCH
cooldown: 20 # In seconds