fixing spawns and monster slowdown.

This commit is contained in:
Sarah 2015-12-06 00:00:50 +01:00
parent 90c6d0a83f
commit 114ae33d89
2 changed files with 24 additions and 14 deletions

View File

@ -49,6 +49,7 @@ import org.bukkit.ChatColor;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.entity.Giant; import org.bukkit.entity.Giant;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -310,6 +311,13 @@ public class TypeWars extends TeamGame
private void initSpawns() private void initSpawns()
{ {
WorldData data = WorldData; 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<Location>)data.GetDataLocs("RED").clone()); _minionSpawns.put(GetTeamList().get(1), (ArrayList<Location>)data.GetDataLocs("RED").clone());
_minionSpawns.put(GetTeamList().get(0), (ArrayList<Location>)data.GetDataLocs("LIGHT_BLUE").clone()); _minionSpawns.put(GetTeamList().get(0), (ArrayList<Location>)data.GetDataLocs("LIGHT_BLUE").clone());
@ -345,12 +353,16 @@ public class TypeWars extends TeamGame
} }
@EventHandler @EventHandler
public void tutorialEnd(GameTutorialEndEvent event) public void tutorialEnd(final GameTutorialEndEvent event)
{
Manager.runSyncLater(new Runnable()
{
@Override
public void run()
{ {
int i = 0;
for(Player player : event.getTutorial().getPlayers().keySet()) for(Player player : event.getTutorial().getPlayers().keySet())
{ {
Location location = event.getTutorial().getTeam().GetSpawns().get(i); Location location = player.getLocation().clone();
for(GameTeam team : GetTeamList()) for(GameTeam team : GetTeamList())
{ {
if(team != event.getTutorial().getTeam()) if(team != event.getTutorial().getTeam())
@ -360,11 +372,10 @@ public class TypeWars extends TeamGame
} }
} }
player.teleport(location); player.teleport(location);
i++;
if(i >= event.getTutorial().getTeam().GetSpawns().size())
i = 0;
} }
} }
}, 7);
}
@Override @Override
public void addTutorials() public void addTutorials()

View File

@ -21,7 +21,6 @@ public class TutorialTypeWars extends GameTutorial
public TutorialTypeWars(ArcadeManager manager) public TutorialTypeWars(ArcadeManager manager)
{ {
super(manager, new TutorialPhase[]{new TutorialPhaseTypeWars()}); super(manager, new TutorialPhase[]{new TutorialPhaseTypeWars()});
this.TeleportOnEnd = false;
} }
@Override @Override