-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cmdadventure.cs
32 lines (29 loc) · 1.28 KB
/
Cmdadventure.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
namespace MCGalaxy
{
public class CmdAdventure : Command
{
public override string name { get { return "Adventure"; } }
public override string shortcut { get { return "ad"; } }
public override string type { get { return "world"; } }
public override bool museumUsable { get { return false; } }
public override LevelPermission defaultRank { get { return LevelPermission.Guest; } }
public override void Use(Player p, string message)
{
if (p.group.Permission >= LevelPermission.Operator) {
Command.Find("map").Use(p, "buildable");
Command.Find("map").Use(p, "deletable");
return;
}
if (!LevelInfo.IsRealmOwner(p.name, p.level.name)) {
p.Message("%cYou do not have permission to use /Adventure in this map."); return;
}
Command.Find("overseer").Use(p, "map buildable");
Command.Find("overseer").Use(p, "map deletable");
}
public override void Help(Player p) {
p.Message("%T/Adventure");
p.Message("%HInstantly toggles buildable and deletable, to turn your map into an \"adventure\" map with unbreakable blocks.");
}
}
}