mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2025-02-05 02:41:24 +01:00
Added Charge
This commit is contained in:
parent
c7d164892c
commit
ad7c42da78
@ -14,8 +14,9 @@ public class Charge extends Spell {
|
||||
@Override
|
||||
public void onRightClick(Player player, int level, PlayerInteractEvent event) {
|
||||
Vector velocity = player.getEyeLocation().getDirection().clone();
|
||||
velocity.normalize();
|
||||
velocity.multiply(level * this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "velocity-per-level"));
|
||||
velocity.setY(0.2);
|
||||
velocity.setY(player.getEyeLocation().getDirection().clone().getY() + 0.2);
|
||||
player.setVelocity(velocity);
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import com.willfp.ecoenchants.nms.BlockBreak;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.metadata.FixedMetadataValue;
|
||||
|
||||
@ -24,6 +25,9 @@ public class Dynamite extends Spell {
|
||||
public void onRightClick(Player player, int level, PlayerInteractEvent event) {
|
||||
Block block = event.getClickedBlock();
|
||||
|
||||
if(!event.getAction().equals(Action.RIGHT_CLICK_BLOCK))
|
||||
return;
|
||||
|
||||
if(block == null) return;
|
||||
|
||||
if (block.hasMetadata("from-drill") || block.hasMetadata("from-lumberjack") || block.hasMetadata("from-blastmining") || block.hasMetadata("from-vein")) {
|
||||
|
@ -21,4 +21,5 @@ general-config:
|
||||
|
||||
config:
|
||||
activation-sound: ENTITY_FIREWORK_ROCKET_LAUNCH
|
||||
cooldown: 20 # In seconds
|
||||
cooldown: 20 # In seconds
|
||||
velocity-per-level: 1.5
|
Loading…
Reference in New Issue
Block a user