From 250110f0ccd71a088d71c78a6134ce9f6d8da751 Mon Sep 17 00:00:00 2001 From: Parsonswy Date: Mon, 22 Mar 2021 18:28:54 -0400 Subject: [PATCH 1/4] Fix launchpads not disppearing if the player switches class before timeout expires. Closes (#142) --- .../trenchpvp/gameclasses/abilities/LaunchPad.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/net/peacefulcraft/trenchpvp/gameclasses/abilities/LaunchPad.java b/src/net/peacefulcraft/trenchpvp/gameclasses/abilities/LaunchPad.java index a07ce66..6cadeea 100644 --- a/src/net/peacefulcraft/trenchpvp/gameclasses/abilities/LaunchPad.java +++ b/src/net/peacefulcraft/trenchpvp/gameclasses/abilities/LaunchPad.java @@ -63,11 +63,13 @@ public void triggerAbility(Event ev) Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(TrenchPvP.getPluginInstance(), new Runnable() { public void run() { + // Remove launch pad + padLoc.getBlock().setType(Material.AIR); + + // Check if we should give the launch pad back to the player. TrenchPlayer t = TeamManager.findTrenchPlayer(p); - if(!(t.getKitType() == TrenchKits.ADRENALINE_JUNKIE)) {return;} - - padLoc.getBlock().setType(Material.AIR); - p.getInventory().setItem(itemIndex, pad); + if(!(t.getKitType() == TrenchKits.ADRENALINE_JUNKIE)) {return;} + p.getInventory().setItem(itemIndex, pad); } }, 300); } From 1a73f82042e0dbc7dee424db1dc43ba26ef8be40 Mon Sep 17 00:00:00 2001 From: Parsonswy Date: Mon, 22 Mar 2021 18:37:01 -0400 Subject: [PATCH 2/4] Fix spy invisibility not lasting long enough & nerf buf time to mitigate multikills. Closes #143. --- .../trenchpvp/gameclasses/abilities/HiddenBlade.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/net/peacefulcraft/trenchpvp/gameclasses/abilities/HiddenBlade.java b/src/net/peacefulcraft/trenchpvp/gameclasses/abilities/HiddenBlade.java index 5d5f9fe..b1640cb 100644 --- a/src/net/peacefulcraft/trenchpvp/gameclasses/abilities/HiddenBlade.java +++ b/src/net/peacefulcraft/trenchpvp/gameclasses/abilities/HiddenBlade.java @@ -15,7 +15,8 @@ public class HiddenBlade extends TrenchAbility{ - private final int EFFECT_TIME = 140; + private final int EFFECT_TIME = 160; + private final int BUFF_TIME = 100; public HiddenBlade(TrenchKit k) { super(k.getTrenchPlayer(), 16000, "Hidden Blade"); @@ -56,7 +57,7 @@ public void triggerAbility(Event ev) { Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(TrenchPvP.getPluginInstance(), new Runnable() { public void run() { - p.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, EFFECT_TIME, 3)); + p.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, BUFF_TIME, 3)); } }, EFFECT_TIME); From b73b3174d9bb4ded58af2b2b42bb03facda45c4a Mon Sep 17 00:00:00 2001 From: Parsonswy Date: Mon, 22 Mar 2021 18:57:37 -0400 Subject: [PATCH 3/4] Fix scout being able to toggle flight if doublejumping while in air Closes (#141) --- .../gameclasses/abilities/DoubleJump.java | 36 ++++++++----------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/src/net/peacefulcraft/trenchpvp/gameclasses/abilities/DoubleJump.java b/src/net/peacefulcraft/trenchpvp/gameclasses/abilities/DoubleJump.java index 4eec13d..fd08216 100644 --- a/src/net/peacefulcraft/trenchpvp/gameclasses/abilities/DoubleJump.java +++ b/src/net/peacefulcraft/trenchpvp/gameclasses/abilities/DoubleJump.java @@ -58,33 +58,27 @@ public void triggerAbility(Event ev) { if(ev instanceof PlayerToggleFlightEvent) { ((PlayerToggleFlightEvent) ev).getPlayer().setFlying(false); ((PlayerToggleFlightEvent) ev).setCancelled(true); + System.out.println("Canceling double jump."); } //Double jump logic if(canDoubleJump && ev instanceof PlayerToggleFlightEvent) { + System.out.println("Vector 1"); Player p = ((PlayerToggleFlightEvent)ev).getPlayer(); Block b = p.getWorld().getBlockAt(p.getLocation().subtract(0,2,0)); - //Check that the user is actually jumping - if(!b.getType().equals(Material.AIR)){ - - //"Boost" their movement vector to simulate a double jump - Vector v = new Vector(p.getVelocity().getX(), p.getVelocity().getY(), p.getVelocity().getZ()); - Vector forward = p.getLocation().getDirection().multiply(0.3); - Vector jump = p.getLocation().getDirection().multiply(0.05).setY(1); - v.add(forward).add(jump); - p.setVelocity(v); - - //Disable flight / jump until they touch the ground. - canDoubleJump = false; - p.setAllowFlight(false); - - } + System.out.println("Vector 2"); + //"Boost" their movement vector to simulate a double jump + Vector v = new Vector(p.getVelocity().getX(), p.getVelocity().getY(), p.getVelocity().getZ()); + Vector forward = p.getLocation().getDirection().multiply(0.3); + Vector jump = p.getLocation().getDirection().multiply(0.05).setY(1); + v.add(forward).add(jump); + p.setVelocity(v); + + //Disable flight / jump until they touch the ground. + canDoubleJump = false; + p.setAllowFlight(false); return; - } - + } } - - - -} +} \ No newline at end of file From f24a565658cd826f71877b358afcd381bb6a090e Mon Sep 17 00:00:00 2001 From: Parsonswy Date: Mon, 22 Mar 2021 19:01:30 -0400 Subject: [PATCH 4/4] Drop demoman axe to stone. Closes (#139) --- .../gameclasses/classConfigurations/TrenchDemoman.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/peacefulcraft/trenchpvp/gameclasses/classConfigurations/TrenchDemoman.java b/src/net/peacefulcraft/trenchpvp/gameclasses/classConfigurations/TrenchDemoman.java index 8bdb317..13b26aa 100644 --- a/src/net/peacefulcraft/trenchpvp/gameclasses/classConfigurations/TrenchDemoman.java +++ b/src/net/peacefulcraft/trenchpvp/gameclasses/classConfigurations/TrenchDemoman.java @@ -86,7 +86,7 @@ public void equipItems() { * Melee Weapon */ - ItemStack melee = new ItemStack(Material.IRON_AXE, 1); + ItemStack melee = new ItemStack(Material.STONE_AXE, 1); ItemMeta meleeMeta = melee.getItemMeta(); meleeMeta.setDisplayName(MELEE_NAME);