From 114ae33d89755f6adf2a43ecfa803ab1bf5a4c05 Mon Sep 17 00:00:00 2001 From: Sarah Date: Sun, 6 Dec 2015 00:00:50 +0100 Subject: [PATCH] fixing spawns and monster slowdown. --- .../arcade/game/games/typewars/TypeWars.java | 37 ++++++++++++------- .../typewars/tutorial/TutorialTypeWars.java | 1 - 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/typewars/TypeWars.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/typewars/TypeWars.java index 5f3df4322..f6cc42a73 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/typewars/TypeWars.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/typewars/TypeWars.java @@ -49,6 +49,7 @@ import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; +import org.bukkit.craftbukkit.v1_8_R3.CraftWorld; import org.bukkit.entity.EntityType; import org.bukkit.entity.Giant; import org.bukkit.entity.Player; @@ -310,6 +311,13 @@ public class TypeWars extends TeamGame private void initSpawns() { WorldData data = WorldData; + + ((CraftWorld) data.World).getHandle().spigotConfig.animalActivationRange = 200; + ((CraftWorld) data.World).getHandle().spigotConfig.monsterActivationRange = 200; + + ((CraftWorld) data.World).getHandle().spigotConfig.animalTrackingRange = 200; + ((CraftWorld) data.World).getHandle().spigotConfig.monsterTrackingRange = 200; + _minionSpawns.put(GetTeamList().get(1), (ArrayList)data.GetDataLocs("RED").clone()); _minionSpawns.put(GetTeamList().get(0), (ArrayList)data.GetDataLocs("LIGHT_BLUE").clone()); @@ -345,25 +353,28 @@ public class TypeWars extends TeamGame } @EventHandler - public void tutorialEnd(GameTutorialEndEvent event) + public void tutorialEnd(final GameTutorialEndEvent event) { - int i = 0; - for(Player player : event.getTutorial().getPlayers().keySet()) + Manager.runSyncLater(new Runnable() { - Location location = event.getTutorial().getTeam().GetSpawns().get(i); - for(GameTeam team : GetTeamList()) + @Override + public void run() { - if(team != event.getTutorial().getTeam()) + for(Player player : event.getTutorial().getPlayers().keySet()) { - location.setPitch(UtilAlg.GetPitch(UtilAlg.getTrajectory(location, _giants.get(team).getLocation()))); - location.setYaw(UtilAlg.GetYaw(UtilAlg.getTrajectory(location, _giants.get(team).getLocation()))); + Location location = player.getLocation().clone(); + for(GameTeam team : GetTeamList()) + { + if(team != event.getTutorial().getTeam()) + { + location.setPitch(UtilAlg.GetPitch(UtilAlg.getTrajectory(location, _giants.get(team).getLocation()))); + location.setYaw(UtilAlg.GetYaw(UtilAlg.getTrajectory(location, _giants.get(team).getLocation()))); + } + } + player.teleport(location); } } - player.teleport(location); - i++; - if(i >= event.getTutorial().getTeam().GetSpawns().size()) - i = 0; - } + }, 7); } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/typewars/tutorial/TutorialTypeWars.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/typewars/tutorial/TutorialTypeWars.java index 03d660b83..dfff09de9 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/typewars/tutorial/TutorialTypeWars.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/typewars/tutorial/TutorialTypeWars.java @@ -21,7 +21,6 @@ public class TutorialTypeWars extends GameTutorial public TutorialTypeWars(ArcadeManager manager) { super(manager, new TutorialPhase[]{new TutorialPhaseTypeWars()}); - this.TeleportOnEnd = false; } @Override