From 0b38b1b6b67d62e213d45c1cd0bae9acb3445d10 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 8 Aug 2017 21:50:19 +0100 Subject: [PATCH] Testing fixes --- .../gui/buttons/KitUpgradeDetailsButton.java | 4 +++- .../games/castlesiegenew/CastleSiegeNew.java | 21 +++++++++++++++++++ .../castlesiegenew/CastleSiegeTNTManager.java | 2 +- .../castlesiegenew/kits/KitHumanMarksman.java | 2 +- .../perks/PerkPaladinBoost.java | 2 +- .../managers/ProgressingKitManager.java | 3 ++- 6 files changed, 29 insertions(+), 5 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/progression/gui/buttons/KitUpgradeDetailsButton.java b/Plugins/Mineplex.Core/src/mineplex/core/progression/gui/buttons/KitUpgradeDetailsButton.java index 11a12c356..b1d53fe15 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/progression/gui/buttons/KitUpgradeDetailsButton.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/progression/gui/buttons/KitUpgradeDetailsButton.java @@ -9,6 +9,8 @@ import org.bukkit.inventory.ItemStack; import com.google.common.collect.Lists; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; +import mineplex.core.common.util.UtilText; import mineplex.core.itemstack.ItemBuilder; import mineplex.core.menu.IconButton; import mineplex.core.progression.ProgressiveKit; @@ -36,7 +38,7 @@ public class KitUpgradeDetailsButton extends IconButton for (String detail : details) { - lore.add(C.cGray + detail); + lore.addAll(UtilText.splitLine(detail, LineFormat.LORE)); } lore.add(""); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeNew.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeNew.java index 1ffbc2e3a..d65b021bd 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeNew.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeNew.java @@ -13,6 +13,7 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.Block; +import org.bukkit.entity.Arrow; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; @@ -98,6 +99,7 @@ public class CastleSiegeNew extends TeamGame private static final int DEFENDER_WIN_TIME = UNDEAD_BURN_TIME + 200; private static final int WOLF_RESPAWN_TIME = 6; private static final long FENCE_NO_CLIP_TIME = TimeUnit.SECONDS.toMillis(2); + private static final int MAX_ARROW_TICKS = 30 * 20; private final Set _listeners = new HashSet<>(); @@ -134,6 +136,7 @@ public class CastleSiegeNew extends TeamGame HungerSet = 20; DeathOut = false; WorldTimeSet = START_TIME; + WorldSoilTrample = true; BlockBreakAllow.add(Material.FENCE.getId()); BlockPlaceAllow.add(Material.FENCE.getId()); InventoryClick = true; @@ -289,6 +292,7 @@ public class CastleSiegeNew extends TeamGame Location location = _kitNPCSpawns.get(i++); Entity entity = kit.SpawnEntity(location); UtilEnt.CreatureLook(entity, lookAt); + UtilEnt.addFlag(entity, UtilEnt.FLAG_ENTITY_COMPONENT); Manager.GetLobby().addKitLocation(entity, kit, location); } @@ -511,6 +515,23 @@ public class CastleSiegeNew extends TeamGame } } + @EventHandler + public void removeOldArrows(UpdateEvent event) + { + if (event.getType() != UpdateType.SEC) + { + return; + } + + for (Entity entity : WorldData.World.getEntities()) + { + if (entity instanceof Arrow && entity.getTicksLived() > MAX_ARROW_TICKS) + { + entity.remove(); + } + } + } + @EventHandler public void pickupArrows(PlayerPickupItemEvent event) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeTNTManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeTNTManager.java index 2bae80fa9..42559f753 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeTNTManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeTNTManager.java @@ -163,7 +163,7 @@ public class CastleSiegeTNTManager implements Listener @EventHandler public void updateExpire(UpdateEvent event) { - if (event.getType() != UpdateType.TICK) + if (event.getType() != UpdateType.TICK || !_host.IsLive()) { return; } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/kits/KitHumanMarksman.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/kits/KitHumanMarksman.java index 296068bf9..b86afd35d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/kits/KitHumanMarksman.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/kits/KitHumanMarksman.java @@ -54,7 +54,7 @@ public class KitHumanMarksman extends KitCastleSiege private static final String MORE_BARRAGE_ARROWS_2 = increaseNumber("Barrage", "Arrows Fired", 2, "Arrows"); private static final String[][] UPGRADES = { { - receiveItem("2 Extra Mushroom Stews", 1) + receiveItem("Extra Mushroom Stews", 2) }, { reduceCooldown("Fletched Arrows", 1) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/perks/PerkPaladinBoost.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/perks/PerkPaladinBoost.java index ea87c4796..b80bbad6a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/perks/PerkPaladinBoost.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/perks/PerkPaladinBoost.java @@ -59,7 +59,7 @@ public class PerkPaladinBoost extends Perk for (Player nearby : UtilPlayer.getNearby(player.getLocation(), RADIUS)) { - if (player.equals(nearby) || !team.HasPlayer(nearby)) + if (!team.HasPlayer(nearby)) { continue; } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/ProgressingKitManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/ProgressingKitManager.java index 66a0dadc6..16cb7c383 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/ProgressingKitManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/ProgressingKitManager.java @@ -162,7 +162,8 @@ public class ProgressingKitManager implements Listener { //Odd, someone else is using a kit system. //Shouldn't ever happen, but we'll be careful. - // Work Tim you really are big headed. + // + // Wow Tim you really are big headed. - Sam return; } if (!((ProgressingKit) kit).canEquipKit(player))