added /eclipse command

This commit is contained in:
k0rd 2013-09-30 22:58:32 -04:00
parent 6a0306596d
commit f08c1449c9
2 changed files with 13 additions and 0 deletions

7
TShockAPI/Commands.cs Executable file → Normal file
View file

@ -185,6 +185,7 @@ namespace TShockAPI
add(Permissions.causeevents, Star, "star");
add(Permissions.causeevents, Fullmoon, "fullmoon");
add(Permissions.causeevents, Bloodmoon, "bloodmoon");
add(Permissions.causeevents, Eclipse, "eclipse");
add(Permissions.causeevents, Invade, "invade");
add(Permissions.causeevents, Rain, "rain");
add(Permissions.spawnboss, Eater, "eater");
@ -1353,6 +1354,12 @@ namespace TShockAPI
TShock.Utils.Broadcast(string.Format("{0} turned on the blood moon.", args.Player.Name), Color.Green);
}
private static void Eclipse(CommandArgs args)
{
TSPlayer.Server.SetEclipse(true);
TShock.Utils.Broadcast(string.Format("{0} has forced an Eclipse!", args.Player.Name), Color.Green);
}
private static void Invade(CommandArgs args)
{
if (Main.invasionSize <= 0)

View file

@ -907,6 +907,12 @@ namespace TShockAPI
Main.bloodMoon = bloodMoon;
SetTime(false, 0);
}
public void SetEclipse(bool Eclipse)
{
Main.eclipse = Eclipse;
SetTime(true, 150);
}
public void SetTime(bool dayTime, double time)
{