Added Charge
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
24
Plugin/src/main/resources/enchants/spell/charge.yml
Normal file
24
Plugin/src/main/resources/enchants/spell/charge.yml
Normal 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
|
||||
Reference in New Issue
Block a user