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.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<Location>)data.GetDataLocs("RED").clone());
_minionSpawns.put(GetTeamList().get(0), (ArrayList<Location>)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

View File

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