diff --git a/src/me/simplicitee/project/addons/MainListener.java b/src/me/simplicitee/project/addons/MainListener.java index 26d47e0..df5bae0 100644 --- a/src/me/simplicitee/project/addons/MainListener.java +++ b/src/me/simplicitee/project/addons/MainListener.java @@ -70,7 +70,7 @@ import me.simplicitee.project.addons.ability.earth.Bulwark; import me.simplicitee.project.addons.ability.earth.Crumble; import me.simplicitee.project.addons.ability.earth.Dig; -import me.simplicitee.project.addons.ability.earth.EarthKick; +import me.simplicitee.project.addons.ability.earth.EarthShove; import me.simplicitee.project.addons.ability.earth.LavaSurge; import me.simplicitee.project.addons.ability.earth.MagmaSlap; import me.simplicitee.project.addons.ability.earth.QuickWeld; @@ -236,8 +236,8 @@ public void onSneak(PlayerToggleSneakEvent event) { return; } - if (canBend(player, "EarthKick")) { - new EarthKick(player); + if (canBend(player, "EarthShove")) { + new EarthShove(player); } else if (canBend(player, "NinjaStance")) { if (CoreAbility.hasAbility(player, NinjaStance.class)) { CoreAbility.getAbility(player, NinjaStance.class).beginStealth(); @@ -309,9 +309,9 @@ public void onEntityChangeBlock(EntityChangeBlockEvent event) { if (e instanceof FallingBlock) { FallingBlock fb = (FallingBlock)e; - if (EarthKick.isBlock(fb)) { + if (EarthShove.isBlock(fb)) { event.setCancelled(true); - EarthKick.removeBlock(fb); + EarthShove.removeBlock(fb); } else if (MagmaSlap.isBlock(fb)) { event.setCancelled(true); ((MagmaSlap) fb.getMetadata("magmaslap").get(0).value()).turnToTempBlock(event.getBlock()); diff --git a/src/me/simplicitee/project/addons/ProjectAddons.java b/src/me/simplicitee/project/addons/ProjectAddons.java index 69a5faa..51a9949 100644 --- a/src/me/simplicitee/project/addons/ProjectAddons.java +++ b/src/me/simplicitee/project/addons/ProjectAddons.java @@ -179,12 +179,12 @@ private void setupConfig() { c.addDefault("Abilities.Earth.Dig.RevertTime", 3500); c.addDefault("Abilities.Earth.Dig.Speed", 0.51); - // EarthKick - c.addDefault("Abilities.Earth.EarthKick.Enabled", true); - c.addDefault("Abilities.Earth.EarthKick.Cooldown", 4000); - c.addDefault("Abilities.Earth.EarthKick.Damage", 0.5); - c.addDefault("Abilities.Earth.EarthKick.MaxBlocks", 9); - c.addDefault("Abilities.Earth.EarthKick.LavaMultiplier", 1.5); + // EarthShove + c.addDefault("Abilities.Earth.EarthShove.Enabled", true); + c.addDefault("Abilities.Earth.EarthShove.Cooldown", 4000); + c.addDefault("Abilities.Earth.EarthShove.Damage", 0.5); + c.addDefault("Abilities.Earth.EarthShove.MaxBlocks", 9); + c.addDefault("Abilities.Earth.EarthShove.LavaMultiplier", 1.5); // LavaSurge c.addDefault("Abilities.Earth.LavaSurge.Enabled", true); diff --git a/src/me/simplicitee/project/addons/ability/earth/EarthKick.java b/src/me/simplicitee/project/addons/ability/earth/EarthShove.java similarity index 94% rename from src/me/simplicitee/project/addons/ability/earth/EarthKick.java rename to src/me/simplicitee/project/addons/ability/earth/EarthShove.java index ae36a52..4c0592c 100644 --- a/src/me/simplicitee/project/addons/ability/earth/EarthKick.java +++ b/src/me/simplicitee/project/addons/ability/earth/EarthShove.java @@ -28,7 +28,7 @@ import me.simplicitee.project.addons.ProjectAddons; -public class EarthKick extends EarthAbility implements AddonAbility, Listener{ +public class EarthShove extends EarthAbility implements AddonAbility, Listener{ private static Set BLOCKS = new HashSet<>(); @@ -42,7 +42,7 @@ public class EarthKick extends EarthAbility implements AddonAbility, Listener{ public List kick; public long duration = 2500; - public EarthKick(Player player) { + public EarthShove(Player player) { super(player); if (getAbility(this.getClass()) == null) { @@ -57,9 +57,9 @@ public EarthKick(Player player) { } public void setFields() { - damage = ProjectAddons.instance.getConfig().getDouble("Abilities.Earth.EarthKick.Damage"); - maxBlocks = ProjectAddons.instance.getConfig().getInt("Abilities.Earth.EarthKick.MaxBlocks"); - lavaMult = ProjectAddons.instance.getConfig().getDouble("Abilities.Earth.EarthKick.LavaMultiplier"); + damage = ProjectAddons.instance.getConfig().getDouble("Abilities.Earth.EarthShove.Damage"); + maxBlocks = ProjectAddons.instance.getConfig().getInt("Abilities.Earth.EarthShove.MaxBlocks"); + lavaMult = ProjectAddons.instance.getConfig().getDouble("Abilities.Earth.EarthShove.LavaMultiplier"); kick = new ArrayList<>(); } @@ -84,7 +84,7 @@ public List getLocations() { @Override public String getName() { - return "EarthKick"; + return "EarthShove"; } @Override @@ -204,7 +204,7 @@ public void remove() { @Override public long getCooldown() { - return ProjectAddons.instance.getConfig().getLong("Abilities.Earth.EarthKick.Cooldown"); + return ProjectAddons.instance.getConfig().getLong("Abilities.Earth.EarthShove.Cooldown"); } @Override @@ -246,6 +246,6 @@ public static void removeBlock(FallingBlock fb) { @Override public boolean isEnabled() { - return ProjectAddons.instance.getConfig().getBoolean("Abilities.Earth.EarthKick.Enabled"); + return ProjectAddons.instance.getConfig().getBoolean("Abilities.Earth.EarthShove.Enabled"); } } diff --git a/src/me/simplicitee/project/addons/ability/fire/CombustBeam.java b/src/me/simplicitee/project/addons/ability/fire/CombustBeam.java index 276df9d..01bef80 100644 --- a/src/me/simplicitee/project/addons/ability/fire/CombustBeam.java +++ b/src/me/simplicitee/project/addons/ability/fire/CombustBeam.java @@ -1,5 +1,6 @@ package me.simplicitee.project.addons.ability.fire; +import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.Material; @@ -11,6 +12,9 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.util.Vector; +import org.bukkit.boss.BarColor; +import org.bukkit.boss.BarStyle; +import org.bukkit.boss.BossBar; import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.ability.AddonAbility; @@ -48,6 +52,8 @@ public class CombustBeam extends CombustionAbility implements AddonAbility { @Attribute("MinDamage") private double minDamage; + private BossBar chargeBar; + private double power, rotation, angleCheck, damage, health; private long chargeTime, revertTime; private int counter; @@ -61,6 +67,12 @@ public class CombustBeam extends CombustionAbility implements AddonAbility { public CombustBeam(Player player) { super(player); + + this.chargeBar = Bukkit.getServer().createBossBar("CombustBeam Charging...", BarColor.WHITE, BarStyle.SEGMENTED_6); + this.chargeBar.setProgress(0); + this.chargeBar.addPlayer(player); + + if (hasAbility(player, CombustBeam.class)) { return; } @@ -85,6 +97,19 @@ public CombustBeam(Player player) { start(); } + + private void UpdateChargeBar() { + double spendMs = System.currentTimeMillis() - this.getStartTime(); + double subtract = spendMs / (maxChargeTime); + double progress = Math.min(1, subtract); + if(chargeBar.getColor()==BarColor.WHITE&&getStartTime() + maxChargeTime <= System.currentTimeMillis()) { + this.chargeBar.setColor(BarColor.RED); + this.chargeBar.setTitle("CombustionBeam Ready"); + } + + this.chargeBar.setProgress(progress); + //ActionBar.sendActionBar(ChatColor.RED + (Math.round(percent * 100) + "%"), player); + } @Override public void progress() { @@ -124,7 +149,8 @@ public void progress() { this.charged = true; GeneralMethods.displayColoredParticle("ff2424", player.getEyeLocation().add(player.getEyeLocation().getDirection().normalize()), 1, 0.4, 0.4, 0.4); player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 10, 5)); - + + UpdateChargeBar(); ActionBar.sendActionBar(ChatColor.RED + "100%", player); } else if (getStartTime() + minChargeTime <= System.currentTimeMillis()) { this.chargeTime = System.currentTimeMillis() - getStartTime() - minChargeTime; @@ -135,7 +161,7 @@ public void progress() { this.power = minPower + (maxPower - minPower) * percent; this.damage = minDamage + (maxDamage - minDamage) * percent; this.charged = true; - + UpdateChargeBar(); ActionBar.sendActionBar(ChatColor.RED + (Math.round(percent * 100) + "%"), player); HexColor color = new HexColor((int) (255 * percent), 136, 136); @@ -239,6 +265,7 @@ public void explode() { @Override public void remove() { super.remove(); + this.chargeBar.removePlayer(this.player); bPlayer.addCooldown(this); }