public override Level CreateLevel(string name) { Level level = new MobHuntLevel(name); level.Initialize(); return(level); }
public override bool Interact(Level currentLevel, Player player, BlockCoordinates blockCoordinates, BlockFace face) { Sign signEntity = currentLevel.GetBlockEntity(blockCoordinates) as Sign; if (signEntity == null) return false; string world = signEntity.Text1; if (player.Level.LevelId.Equals(world)) return true; if (!Worlds.ContainsKey(player.Level.LevelId)) { Worlds.Add(player.Level.LevelId, player.Level); } if (!Worlds.ContainsKey(world)) { var mobHuntLevel = new MobHuntLevel(world, new FlatlandWorldProvider()); mobHuntLevel.Initialize(); Worlds.Add(world, mobHuntLevel); } Level level = Worlds[world]; player.SpawnLevel(level); level.BroadcastTextMessage(string.Format("{0} teleported to world <{1}>.", player.Username, level.LevelId)); return true; }
public override bool Interact(Level currentLevel, Player player, BlockCoordinates blockCoordinates, BlockFace face) { Sign signEntity = currentLevel.GetBlockEntity(blockCoordinates) as Sign; if (signEntity == null) { return(false); } string world = signEntity.Text1; if (player.Level.LevelId.Equals(world)) { return(true); } if (!Worlds.ContainsKey(player.Level.LevelId)) { Worlds.Add(player.Level.LevelId, player.Level); } if (!Worlds.ContainsKey(world)) { var mobHuntLevel = new MobHuntLevel(world, new FlatlandWorldProvider()); mobHuntLevel.Initialize(); Worlds.Add(world, mobHuntLevel); } Level level = Worlds[world]; player.SpawnLevel(level); level.BroadcastTextMessage(string.Format("{0} teleported to world <{1}>.", player.Username, level.LevelId)); return(true); }
public override Level CreateLevel(string name) { Level level = new MobHuntLevel(name); level.Initialize(); return level; }